15,978
社区成员
发帖
与我相关
我的任务
分享
BOOL CMyApp::InitInstance()
{
// ...
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MYTYPE,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CMDIChildWnd), // standard MDI child frame
RUNTIME_CLASS(CMyView));
AddDocTemplate(pDocTemplate);
// Create main MDI Frame window.
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
// Save the pointer to the main frame window. This is the
// only way the framework will have knowledge of what the
// main frame window is.
m_pMainWnd = pMainFrame;
// enable file manager drag/drop and DDE Execute open
EnableShellOpen();
RegisterShellFileTypes();
// ...
// Show the main window using the nCmdShow parameter
// passed to the application when it was first launched.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
// ...
}