MFC MDI 2nd main window problem
-
I have an MFC MDI application that works fine. I'm trying to add another window, outside of the main MDI window. When I create the child view for this 2nd window, a new blank view appears in the main MDI window, leaving the 2nd window frame blank. The frame, and view class are different for the 2nd window. I've tried tracing through the code and I can't figure out how the main window takes my new child window. There's something built into MFC that is causing this. What am I missing, how can I work around it? Naturally, I can create the window and ignore the frame/document/view architecture, but I'd rather not do that. If the following looks a bit strange, I'm following the example of an MFC wizard generated app without document and view support (the document isn't needed). I'm using this approach to try and reduce the ties to frame/document/view and make this work. Tried it the standard way and it didn't go either. { CMDIFrameWnd* pFrame2 = new CCalendarFrame; // create secondary MDI frame window if (!pFrame2->LoadFrame(IDR_CALENDARTYPE)) return; // create a new MDI child window pFrame2->CreateNewChild( RUNTIME_CLASS(CCalChildFrm), IDR_CALENDARTYPE, NULL, NULL); // The main window has been initialized, so show and update it. pFrame2->ShowWindow(SW_SHOWNORMAL); pFrame2->UpdateWindow(); } Thanks!