|
-
June 2nd, 1999, 10:17 AM
#1
MultiDocTemplate
How do I open a new view without opening a new document. For example, two CFormViews on the same Document.
-
June 2nd, 1999, 11:59 AM
#2
Re: MultiDocTemplate
try something like this from a message handler in the document:
CMDIChildWnd *pActiveChild = ((CMDIFrameWnd*)AfxGetApp()->m_pMainWnd)->MDIGetActive();
if ( pActiveChild == NULL )
return;
CMyTemplate *pTemplate = ((CMyApp *)AfxGetApp())->MyTemplate();
CRuntimeClass *pOldView = pTemplate->SetView( RUNTIME_CLASS( CAnotherView ) );
UINT nOldID = pTemplate->SetID( IDR_GRIDVIEW );
ASSERT_VALID(pTemplate);
CFrameWnd *pFrame = pTemplate->CreateNewFrame( this, pActiveChild );
ASSERT( pFrame );
if ( pFrame == NULL )
return;
pTemplate->InitialUpdateFrame( pFrame, this );
-
June 3rd, 1999, 04:00 AM
#3
Re: MultiDocTemplate
To do it manually, use CDocument::AddView(CView*).
Otherwise, create another CDocTemplate with the same document but a new view.
Dave
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|