16,551
社区成员
发帖
与我相关
我的任务
分享
pDocTemplate1 = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMyDoc1),
RUNTIME_CLASS(CMyFrame1), // main SDI frame window
RUNTIME_CLASS(CMyView1));
AddDocTemplate(pDocTemplate1);
pDocTemplate2 = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMyDoc2),
RUNTIME_CLASS(CMyFrame2), // main SDI frame window
RUNTIME_CLASS(CMyView2));
AddDocTemplate(pDocTemplate2);
...
CMainDlg MainDlg;
m_pMainWnd = &MainDlg;
MainDlg.DoModal();
theApp.pDocTemplate1->OpenDocumentFile(NULL);
CBrowseDoc *pDoc = (CBrowseDoc *)theApp.pDocTemplateBrowse->OpenDocumentFile(NULL);
POSITION Pos = pDoc->GetFirstViewPosition();
CBrowseView *pView = (CBrowseView *)pDoc->GetNextView(Pos);
pBrowseFrm = (CBrowseFrame *)pView->GetParentFrame();
pMainDlg->ShowWindow(SW_HIDE);
pDocTemplateBrowse = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CBrowseDoc),
RUNTIME_CLASS(CBrowseFrame), // main SDI frame window
RUNTIME_CLASS(CBrowseView));
AddDocTemplate(pDocTemplateBrowse);
pDocTemplateAdd = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CAddNewDoc),
RUNTIME_CLASS(CAddNewFrame), // main SDI frame window
RUNTIME_CLASS(CAddNewView));
AddDocTemplate(pDocTemplateAdd);
// Parse command line for standard shell commands, DDE, file open
/* CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
*/
CMainDlg MainDlg;
m_pMainWnd = &MainDlg;
MainDlg.DoModal();
theApp.pDocTemplateAdd->OpenDocumentFile(NULL);//如何获取这个创建的 SDI 的框架指针
pMainDlg->ShowWindow(SW_HIDE);