Generated using the VS08 Program Wizard, single-document program, default settings. The project name is 3view;
Where the default generated view class Cmy3viewview, corresponding to 3viewview.h,3viewview.cpp;
The default generated document class is: 3viewdoc.h,3viewdoc.cpp;
In the main frame header file MainFrm.h, add the following header file;//For the sake of good back to create the program default view Cmy3viewview;
#include "3viewDoc.h"
#include "3viewView.h"
and add the following variables
CSplitterWnd M_wndsplitter;
CSplitterWnd M_WNDSPLITTERTB;
CSplitterWnd M_WNDSPLITTERTB2;
and overloading the OnCreateClient function
1BOOL cmainframe::oncreateclient (lpcreatestruct lpcs, ccreatecontext*pContext)2 {3 //Todo:add your specialized code here and/or call the base class4 CRect CT;5GetClientRect (&CT);6M_wndsplitter.createstatic ( This,1,3);//The main frame is divided around 1 rows and 3 columns7 8M_wndsplittertb.createstatic (&m_wndsplitter,2,1, ws_child| Ws_visible,m_wndsplitter.idfromrowcol (0,0));//in the 1th row of M_wndsplitter, the 1th column is divided into 2 rows and 1 columns .9M_wndsplittertb2.createstatic (&m_wndsplitter,3,1, ws_child| Ws_visible,m_wndsplitter.idfromrowcol (0,1));//in the 1th row of M_wndsplitter, the 2nd column is divided into 2 rows and 1 columns .Ten OneM_wndsplittertb.createview (0,0, Runtime_class (Cdefformview), CSize (Ct. Width ()/3Ct. Height ()/2), PContext);//Create 1th row 1th column view in M_WNDSPLITTERTB AM_wndsplittertb.createview (1,0, Runtime_class (Cdefformview), CSize (Ct. Width ()/3Ct. Height ()/2), PContext);//Create 2nd row 1th column view in M_WNDSPLITTERTB - -M_wndsplittertb2.createview (0,0, Runtime_class (Cdefformview), CSize (Ct. Width ()/3Ct. Height ()/3), PContext);//Create 1th row 1th column view in M_WNDSPLITTERTB2 theM_wndsplittertb2.createview (1,0, Runtime_class (Cmy3viewview), CSize (Ct. Width ()/3Ct. Height ()/3), PContext);//Create 2nd row 1th column view in M_WNDSPLITTERTB2 -M_wndsplittertb2.createview (2,0, Runtime_class (Cdefformview), CSize (Ct. Width ()/3Ct. Height ()/3), PContext);//Create 3rd row 1th column view in M_WNDSPLITTERTB2 - -M_wndsplitter.createview (0,2, Runtime_class (Cmy3viewview), CSize (Ct. Width ()/3,0), PContext);//Create a view of the 1th row 3rd column of the main frame + - //get the object of the corresponding view +cmy3viewview* view = (Cmy3viewview *) M_wndsplitter.getpane (0,2); Acdefformview* view2 = (cdefformview*) M_wndsplittertb.getpane (0,0); at -M_is_spilit =TRUE; - returnTRUE; - //return CFrameWnd::OnCreateClient (LPCs, pContext); -}
MFC single document split area (CSPLITTERWND)