.net forms and code generation

Chris Jones

26-10-2005 18:42:29

hey, sorry this isnt exactly todo with OgreDotNet, more of a .net question

im using C++ with managed extensions for my level editor, so i can use .net forms for the gui. when a gui element (control) is added, the variable is put in the .h file along with the code to create a new instance and position it etc

i have to include a .h file for my ApplicationManager so the form class can cal various functions of the application manager, and application manager has to include the form .h so it can create the window etc. this means i have to put 1 of the includes in the .cpp file so that i dont get the problem where 2 classes include each other

the problem is, that because of this, i have to put the functions from the form in the .cpp file rather than where the IDE places the generated code (in the .h) file. now i have some code in there, when i add a new control to the form, it places the variable name in the .cpp file underneath my code, where as it should be in the .h file above all the code

because of this, i get errors and i have to manually move the variable declaration to the right place. this is getting very tedious and it shouldnt be doing it, but i cant work out how to solve this

has anyone experienced this before? anyone have any idea how to solve this?

thanks