Instantiating Windows Form
-
Heyas all, I've added a new form to my project called ExitForm. In the main form of the project I've added #include "ExitForm.h". I'm trying to do the following:
void onSomeEvent(object^ sender, EventArgs^ e) { ExitForm^ eForm = gcnew ExitForm(); eForm->ShowDialog(); }
I get ExitForm: undeclared identifier Can anyone shed some light on what I'm forgetting to do to make ExitForm visible to other files in the project? Thanks, John -
Heyas all, I've added a new form to my project called ExitForm. In the main form of the project I've added #include "ExitForm.h". I'm trying to do the following:
void onSomeEvent(object^ sender, EventArgs^ e) { ExitForm^ eForm = gcnew ExitForm(); eForm->ShowDialog(); }
I get ExitForm: undeclared identifier Can anyone shed some light on what I'm forgetting to do to make ExitForm visible to other files in the project? Thanks, JohnI don't see any problem with your code. do you have in ExitForm.h: public ref class ExitForm : public System::Windows::Forms::Form or did you define namespace?
-
I don't see any problem with your code. do you have in ExitForm.h: public ref class ExitForm : public System::Windows::Forms::Form or did you define namespace?
Yes, the form was created by visual studio, so the namespace is correct, and the form is inherited correctly. This is driving me nuts! Thanks, John
-
Yes, the form was created by visual studio, so the namespace is correct, and the form is inherited correctly. This is driving me nuts! Thanks, John
Did you have any syntax problem in ExitForm.h? If no then delete/remove ExitForm.h And Recreate
-
Did you have any syntax problem in ExitForm.h? If no then delete/remove ExitForm.h And Recreate
OK, I deleted all files pertaining to my form, and recreated, then deleted all precompiled headers etc. and now it works perfectly. that is rediculous. grrr thanks a ton for your help though :) Thanks, John