I have been having this problem as well, and in my search for a solution I found several threads like this where noone posed a solution. However, I potentially have one for you!!!
I have found that when your code gets quite large the auto generated code gets really REALLY messy! It even puts duplicate lines in and inserts code in the wrong place causing errors!!!
If moving the code to where it is supposed to be doesn't fix it, then there is another thing that the auto generated code forgets and is VERY picky about. Look for lines that are missing the "this->" parts! For example, it will start auto generating lines like the following:
Button_MyButton = (gcnew System::Windows::Forms::Button());
However if you add the "this->" part like its supposed to do like the following:
this->Button_MyButton = (gcnew System::Windows::Forms::Button());
then it stops complaining!
When your code gets large and these errors start occuring, you have to be very careful with the auto generated code!
I hope this helps people out there and saves them some time...
Cheers, Carl
|