All what I have Done is as follows
First I define a Pagecontainer in mainframe
public:
CExtWRB < CExtTabPageContainerOneNoteWnd > m_wndTabPageContainer;
Then I add another wnd in the Pagecontainer In OnCreate() of mainframe
CWinApp * pApp = ::AfxGetApp();
ASSERT( pApp != NULL );
ASSERT( pApp->m_pszRegistryKey != NULL );
ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) );
ASSERT( pApp->m_pszProfileName != NULL );
ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );
pApp;
m_wndTabPageContainer.Create(
this,
CRect(0,0,0,0),
AFX_IDW_PANE_FIRST
);
m_wndTabPageContainer.OrientationSet( __ETWS_ORIENT_TOP );
VERIFY(
m_wndTest.Create(
CViewTest::IDD,
&m_wndTabPageContainer
)
);
m_wndTest.ShowSizeGrip( FALSE );
VERIFY(
m_wndTabPageContainer.PageInsert(
&m_wndTest,
_T("Tabbed &Toolbar Options")
)
);
if( CExtNCW < CFrameWnd >::OnCreate(lpCreateStruct) == -1 )
{
ASSERT( FALSE );
return -1;
}
Finally,I add my main view in the Pagecontainer in the OnCreate() of my view
int CXXSView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CMainFrame* pMain=(CMainFrame*)AfxGetMainWnd();
pMain->m_wndTabPageContainer.PageInsert(this,"view" , NULL,
true,0,true);
return 0;
}
Is there any thing wrong? And any wise suggestion? Thank you!