MFC loading form
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
Can someone give the way to load a particular form or dialog on execution of an MFC appwizard application? Drushti
That depends on how you made the application. If you're using the document/view architecture then just make the view class a CFormView (it's the last step when using the wizard). If not then use this workaround: (a) Create a dialog resource, and make a class for it. MAKE SURE TO OVERRIDE THE OnOk and OnCancel functions. (b) In your application add the dialog as a member variable. (c) In your applications' OnCreate function, create the dialog by calling CDialog::Create, put WS_CHILD | WS_VISIBLE for the style. DO NOT CALL DoModal.