BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { m_wndSplitter.CreateStatic(this,1,2); //创建分割窗口 //创建视图 m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CRandomDivisionView), CSize(100,200), pContext); m_ChildWnd.CreateStatic(&m_wndSplitter,2,1,WS_CHILD|WS_VISIBLE, m_wndSplitter.IdFromRowCol(0,1)); //为子窗口创建分割窗口 m_ChildWnd.CreateView(0,0,RUNTIME_CLASS(CRandomDivisionView), CSize(100,100),pContext); m_ChildWnd1.CreateStatic(&m_ChildWnd,1,2,WS_CHILD|WS_VISIBLE, m_ChildWnd.IdFromRowCol(1,0)); //为子窗口创建分割窗口 m_ChildWnd1.CreateView(0,0,RUNTIME_CLASS(CRandomDivisionView), CSize(100,100),pContext); m_ChildWnd2.CreateStatic(&m_ChildWnd1,2,1,WS_CHILD|WS_VISIBLE, m_ChildWnd1.IdFromRowCol(0,1)); //为子窗口创建分割窗口 m_ChildWnd2.CreateView(0,0,RUNTIME_CLASS(CRandomDivisionView), CSize(100,100),pContext); m_ChildWnd3.CreateStatic(&m_ChildWnd2,1,2,WS_CHILD|WS_VISIBLE, m_ChildWnd2.IdFromRowCol(1,0)); //为子窗口创建分割窗口 m_ChildWnd3.CreateView(0,0,RUNTIME_CLASS(CRandomDivisionView), CSize(100,100),pContext); m_ChildWnd3.CreateView(0,1,RUNTIME_CLASS(CRandomDivisionView), CSize(100,100),pContext); return TRUE; //设置返回值 //return CFrameWnd::OnCreateClient(lpcs, pContext); //不调用基类的方法 }
|