if (AfxGetMainWnd()->IsKindOf(RUNTIME_CLASS(CMDIFrameWndEx)))意思
欧文 2012-05-29 02:58:31 请问大家这句话是什么意思啊,
VS2010 MDI文档程序,outputwnd.app 160行
void COutputList::OnContextMenu(CWnd* /*pWnd*/, CPoint point)
{
CMenu menu;
menu.LoadMenu(IDR_OUTPUT_POPUP);
CMenu* pSumMenu = menu.GetSubMenu(0);
if (AfxGetMainWnd()->IsKindOf(RUNTIME_CLASS(CMDIFrameWndEx)))
{
CMFCPopupMenu* pPopupMenu = new CMFCPopupMenu;
if (!pPopupMenu->Create(this, point.x, point.y, (HMENU)pSumMenu->m_hMenu, FALSE, TRUE))
return;
((CMDIFrameWndEx*)AfxGetMainWnd())->OnShowPopupMenu(pPopupMenu);
UpdateDialogControls(this, false);
}
SetFocus();
}
右键菜单显示不出来,大概是这句话的原因。什么意思,怎么解决呢,我的程序没用到文档。只用框架!!!