CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CEISSERVERDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CMainFormView)); CWinApp *theApp = AfxGetApp(); theApp->m_pMainWnd->ShowWindow(SW_HIDE); theApp->AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; theApp->ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line if (!theApp->ProcessShellCommand(cmdInfo)) return ; // The one and only window has been initialized, so show and update it. theApp->m_pMainWnd->ShowWindow(SW_SHOW); theApp->m_pMainWnd->UpdateWindow();我在OnButton1()里面这第写的。结果弹出来一个小框框,先喊我选择一个模版,然后再弹了一个全新的SDI出来 。。
doc->AddView(view指针);
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CEISSERVERDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMainFormView)); CWinApp *theApp = AfxGetApp();
theApp->m_pMainWnd->ShowWindow(SW_HIDE);
theApp->AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
theApp->ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line
if (!theApp->ProcessShellCommand(cmdInfo))
return ; // The one and only window has been initialized, so show and update it.
theApp->m_pMainWnd->ShowWindow(SW_SHOW);
theApp->m_pMainWnd->UpdateWindow();我在OnButton1()里面这第写的。结果弹出来一个小框框,先喊我选择一个模版,然后再弹了一个全新的SDI出来 。。