This method creates a static splitter window.
BOOL CreateStatic( CWnd* pParentWnd, int nRows, int nCols, DWORD dwStyle = WS_CHILD | WS_VISIBLE, UINT nID = AFX_IDW_PANE_FIRST );
Nonzero if it is successful; otherwise, it is zero.
This method creates the panes for a static splitter window. All panes of a static splitter window must be created before the framework displays the splitter.
The framework also calls this method to create new panes when the user of a dynamic splitter window splits a pane, row, or column.
virtual BOOL CreateView( int row, int col, CRuntimeClass* pViewClass, SIZE sizeInit, CCreateContext* pContext );
Nonzero if it is successful; otherwise, it is zero.
比如
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { // TODO: Add your specialized code here and/or call the base class split.CreateStatic(this,2,1); split.CreateView(0,0,RUNTIME_CLASS(CTest3View),CSize(0,150),pContext); split.CreateView(1,0,RUNTIME_CLASS(CTest3View),CSize(0,0),pContext); return CMDIChildWnd::OnCreateClient(lpcs, pContext); }
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { // TODO: Add your specialized code here and/or call the base class split.CreateStatic(this,1,2); split.CreateView(0,0,RUNTIME_CLASS(CTest3View),CSize(150,0),pContext); split.CreateView(0,1,RUNTIME_CLASS(CTest3View),CSize(0,0),pContext); return CMDIChildWnd::OnCreateClient(lpcs, pContext); }
CMultiDocTemplate* pDocTemplate; pDocTemplate = new CMultiDocTemplate( IDR_TEST3TYPE, RUNTIME_CLASS(CTest3Doc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame NULL); AddDocTemplate(pDocTemplate);