3,245
社区成员
发帖
与我相关
我的任务
分享
CWinApp* pApp = AfxGetApp();
CDocTemplate* pDocTemplate;
POSITION pos = pApp->GetFirstDocTemplatePosition();
pDocTemplate = pApp->GetNextDocTemplate(pos);
ASSERT(pDocTemplate);
CFrameWnd* pNewFrame = pDocTemplate->CreateNewFrame(GetDocument(),(CFrameWnd*)GetParentFrame());
ASSERT(pNewFrame);
// Activate the frame and set its active view
pDocTemplate->InitialUpdateFrame(pNewFrame, NULL);
CYourView* pWBVw = (CYourView*)pNewFrame->GetActiveView();
ASSERT(pWBVw);
pWBVw->SetRegisterAsBrowser(TRUE);
*ppDisp = pWBVw->GetApplication();