Communicating with top level form from child forms
-
Using the designer to create the main form for an application generated the following code in the .cpp file: int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA; Application::Run(new DataForm(lpCmdLine)); return 0; } The DataForm class has a button which generates a new form: linkedForm = new LinkedForm() ; The LinkedForm class exists in the same namespace as the DataForm class. What needs to be done to allow this child form to see public methods in it's parent, since a DataForm ptr cannot be declared globally? Are there any examples of parent/child form communications of this nature? Thanks, MrHonus
-
Using the designer to create the main form for an application generated the following code in the .cpp file: int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA; Application::Run(new DataForm(lpCmdLine)); return 0; } The DataForm class has a button which generates a new form: linkedForm = new LinkedForm() ; The LinkedForm class exists in the same namespace as the DataForm class. What needs to be done to allow this child form to see public methods in it's parent, since a DataForm ptr cannot be declared globally? Are there any examples of parent/child form communications of this nature? Thanks, MrHonus
seems this is not a standard MFC program, u might post it to Manage C++/CLI forum. life is like a box of chocolate,you never know what you r going to get.
-
Using the designer to create the main form for an application generated the following code in the .cpp file: int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA; Application::Run(new DataForm(lpCmdLine)); return 0; } The DataForm class has a button which generates a new form: linkedForm = new LinkedForm() ; The LinkedForm class exists in the same namespace as the DataForm class. What needs to be done to allow this child form to see public methods in it's parent, since a DataForm ptr cannot be declared globally? Are there any examples of parent/child form communications of this nature? Thanks, MrHonus
Is it CLI/C++_**
**_
whitesky
-
Is it CLI/C++_**
**_
whitesky