My document has multiple views. I am adding another view whose frame class is different and it initial size comes up to zero (just the title bar of the window shows up).
I have other views added too and they work fine. I know the difference is that these other views have the same CFrameWnd in the CMultiDocTemplate but this new view has a difference frame classCode:CChildFrame* pNewFrame = (CChildFrame*) theApp.m_pMyDocTemplate->CreateNewFrame( pDoc, pFrame ); // create new view if (pNewFrame != NULL ) pNewFrame->InitialUpdateFrame(pDoc, TRUE);
As you can see from the definitions, when I add m_pTest2DocTemplate it works fine because the CChildFrame is the same but adding m_pTest3DocTemplate starts the new view in zero size perhaps because of different frame class?Code:m_pTestDocTemplate = new CMultiDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CTestDoc), RUNTIME_CLASS(CChildFrame), RUNTIME_CLASS(CTestView)); AddDocTemplate(m_pTestDocTemplate); m_pTest2DocTemplate = new CMultiDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CTestDoc), RUNTIME_CLASS(CChildFrame), RUNTIME_CLASS(CTest2View)); AddDocTemplate(m_pTest2DocTemplate); m_pTest3DocTemplate = new CMultiDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CTestDoc), RUNTIME_CLASS(CChildCustomFrame), // custom MDI child frame RUNTIME_CLASS(CTest3View)); AddDocTemplate(m_pTestDocTemplate);
What is the strategy to add the view if their is a different frame class involved as well? The custom frame class that I am using controls the sizing requirements of the view in my case.




Reply With Quote