implementing splitter windows
-
I would so appreciate someone telling me what I'm failing to do in implementing splitter windows in an SDI app. A boiled down version of my program--default MFC SDI app created with MSVS 6 app wizard, accepting all the defaults. Using ClassWizard, I add a new view class derived from CEditView. I then add a public CSplitterWnd object to CMainFrame, and override the OnCreateClient() function with the following code (this code is taken more or less verbatim from the MFC sample DaoView): BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { if (!m_Splitter.CreateStatic(this, 1, 2)) {/*error handling*/} if (!m_Splitter.CreateView(0, 0, pContext->m_pNewViewClass, CSize(100, 50), pContext)) {/*error handling*/} if (!m_Splitter.CreateView(0, 1, RUNTIME_CLASS(CSplitEditView), CSize(0,0), pContext)) {/*error handling*/} SetActiveView((CView*)m_Splitter.GetPane(0, 1)); return CFrameWnd::OnCreateClient(lpcs, pContext); } Program compiles fine, runs fine, but with no splitters. What am I leaving out? TIA
-
I would so appreciate someone telling me what I'm failing to do in implementing splitter windows in an SDI app. A boiled down version of my program--default MFC SDI app created with MSVS 6 app wizard, accepting all the defaults. Using ClassWizard, I add a new view class derived from CEditView. I then add a public CSplitterWnd object to CMainFrame, and override the OnCreateClient() function with the following code (this code is taken more or less verbatim from the MFC sample DaoView): BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { if (!m_Splitter.CreateStatic(this, 1, 2)) {/*error handling*/} if (!m_Splitter.CreateView(0, 0, pContext->m_pNewViewClass, CSize(100, 50), pContext)) {/*error handling*/} if (!m_Splitter.CreateView(0, 1, RUNTIME_CLASS(CSplitEditView), CSize(0,0), pContext)) {/*error handling*/} SetActiveView((CView*)m_Splitter.GetPane(0, 1)); return CFrameWnd::OnCreateClient(lpcs, pContext); } Program compiles fine, runs fine, but with no splitters. What am I leaving out? TIA