; if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
替换成:
UINT nID;
nID=IDR_MAINFRAME;
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(nID))
return FALSE;
m_pMainWnd = pMainFrame;
CMultiDocTemplateEx* pDocTemplate;
pDocTemplate = new CMultiDocTemplateEx(
IDR_TESTMDTYPE,
RUNTIME_CLASS(CTestMDIDoc),
// custom MDI child frame
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CTestMDIView),
&nID,1);
AddDocTemplate(pDocTemplate);
CWinAppEx::InitInstance();
接下来就可以编释并运行你的
程序了。
如果你想自己掌控智能菜单的话,可直接重载CmenuBar类中的下面涵数既可:
WORD CMenuBar::IncMenuUsage(CMenuEx *pParent,
UINT pos,
WORD curusage)
BOOL CMenuBar::EvaluateIfGrayed(CMenuEx *pParent,
UINT pos,
WORD &curusage,
&