MDI application
-
How can I create an MDI application in MFC ?? A) NOT Doc/View B) Dialog Based there is a way in the MFC app wizard, at the end before 'Finish' Change from 'CView' to 'CFormView'. Then it's a dialog BUT Doc/View. Is there any easy other way ?? Name: STR BTW: for some of you that wished for CodeProject irc server I create a channle on DalNet called "#CodeProject"
-
How can I create an MDI application in MFC ?? A) NOT Doc/View B) Dialog Based there is a way in the MFC app wizard, at the end before 'Finish' Change from 'CView' to 'CFormView'. Then it's a dialog BUT Doc/View. Is there any easy other way ?? Name: STR BTW: for some of you that wished for CodeProject irc server I create a channle on DalNet called "#CodeProject"
Don't know if this is an "easy" way, but it seems to work (I haven't tested it much). The idea is to replace the generated view window with a property page. 1. Generate a standard MDI project without Doc/View support. 2. Remove the generated CWnd derived view class from the project. 3. Add a FormView dialog resource and create a new CPropertyPage derived class attached to it. 4. In your CMDIChildWnd, replace the old view with an instance of your new CPropertyPage class. 5. In the child frame's WM_CREATE handler, remove the code to create the old view. Replace it with something like this:
m_wndView.Create(IDD_MAINVIEW, this); // Create a CPropertyPage based view
SetWindowLong(m_wndView.m_hWnd, GWL_STYLE, WS_CHILD | WS_VISIBLE); // Make it a child to the childframe
m_wndView.SetDlgCtrlID(AFX_IDW_PANE_FIRST); // Set the view to be first pane.6. In CChildFrame::OnCmdMsg(), don't call the view's OnCmdMsg. -------------- "Aagh!! I'm a victim of a Random Act of Management!"