i wrote a SDI app with outlook style UI:
it has several views,you may click the button in the left pane to switch to the corresponding view in the right pane.
i created all views(apart from the view created by MFC)when program began(in CMainFrame::OnCreateClint(),for example),but i came across a problem when switching views:(i used Kirk Stowell's code)
BOOL CCJFlatSplitterWnd::SwitchView(int nRow, int nCol, CView *pNewView)
CView *pOldView = DYNAMIC_DOWNCAST( CView,GetPane( nRow, nCol ));
ASSERT_KINDOF( CView, pOldView );
if( pOldView == pNewView )
int nOldID, nNewID;
nOldID = pOldView->GetDlgCtrlID();
nNewID = pNewView->GetDlgCtrlID();
the method recalclayout() always goes wrong:
debug assertion failed!
i think the problem is that the view to switch is not 'attached' to the right pane,is it right?
please help me!