6600gt
17-09-2006, 12:49
I am using Visual C++ 2005 Express Edition with .NET2 Framework to create an application with multiple forms.
I have one main form which is the MDI (Multiple Document Interface) parent. Then I have multiple other MDI Children forms. I am using the designer to create my forms and then using the code editor to program the functionality that I want. This way I use all header files, no .cpp files.
I am able to access/inherit the other MDI Children forms from the main parent form, using this syntax, static Form1^ form1 = gcnew Form1;. And I also have the #include "Form1.h" defined in the main.h.
The problem occurs when I try to inherit the main form or any of its components form the other forms. For example, I need to inherit seralPort1 form main.h, but I can't. It gives me some basic errors which are related to not including the main.h in the other form, but I did include it.
If I add this under the public ref class Form1...
private: static Main::serialPort1^ serialport = gcnew Main::serialPort1; I get errors like Main is an undecleared identifier... and so on.
I searched the help files and the internet, but I could not find anything helpful. Now I know that C (RC code ) and C++ are quite different, but I don't know what these differences are.
Can you guys help me?
Thanks a lot
I have one main form which is the MDI (Multiple Document Interface) parent. Then I have multiple other MDI Children forms. I am using the designer to create my forms and then using the code editor to program the functionality that I want. This way I use all header files, no .cpp files.
I am able to access/inherit the other MDI Children forms from the main parent form, using this syntax, static Form1^ form1 = gcnew Form1;. And I also have the #include "Form1.h" defined in the main.h.
The problem occurs when I try to inherit the main form or any of its components form the other forms. For example, I need to inherit seralPort1 form main.h, but I can't. It gives me some basic errors which are related to not including the main.h in the other form, but I did include it.
If I add this under the public ref class Form1...
private: static Main::serialPort1^ serialport = gcnew Main::serialPort1; I get errors like Main is an undecleared identifier... and so on.
I searched the help files and the internet, but I could not find anything helpful. Now I know that C (RC code ) and C++ are quite different, but I don't know what these differences are.
Can you guys help me?
Thanks a lot