MFC 分栏

class CMainFrame : public CFrameWnd
{
public:

CSplitterWnd wndSplitter;

}

 

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: 在此添加专用代码和/或调用基类
if(wndSplitter.CreateStatic(this,1,2)==NULL);
//if(wndSplitter.CreateStatic(this,1,2,WS_CHILD|WS_VISIBLE)==NULL);
wndSplitter.CreateView(0,0,RUNTIME_CLASS(CLeftView),CSize(100,100), pContext);
wndSplitter.CreateView(0,1,RUNTIME_CLASS(CRightView),CSize(100,100),pContext);
return true;
//return CFrameWnd::OnCreateClient(lpcs, pContext);
}

注意:最后一行必须注释;改为return ture

你可能感兴趣的:(mfc)