为什么我在创建splitter窗口时,总会断言失败
1. 在CMainFrame类中声明两个protected CSplitterWnd m_wndSpMain, m_wndSpSub;成员.
2. 在CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)下生成:
m_wndSpMain.CreateStatic(this,1,2,WS_CHILD|WS_VISIBLE,AFX_IDW_PANE_FIRST);
m_wndSpMain.CreateView(0,1,RUNTIME_CLASS(CtoolBarView),CSize(100,100),pContext);
总是会在CWnd* CSplitterWnd::GetPane(int row, int col) const中失败:
CWnd* pView = GetDlgItem(IdFromRowCol(row, col));
ASSERT(pView != NULL); // panes can be a CWnd, but are usually CViews
pView总是为空。不知道这是为什么?望请帮忙看下。