菜鸟问题(在线等)
如果删除VC默认生成的MDI程序的菜单在添加自己的菜单就会在pMainFrame->LoadFrame这里出错,
错误是:
Debug Assertion Faild
file xxxxxx\winmdi.cpp
line 139
出现错误的代码是:
BOOL CMDIFrameWnd::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext*)
{
CMenu* pMenu = NULL;
if (m_hMenuDefault == NULL)
{
// default implementation for MFC V1 backward compatibility
pMenu = GetMenu();
ASSERT(pMenu != NULL);
// This is attempting to guess which sub-menu is the Window menu.
// The Windows user interface guidelines say that the right-most
// menu on the menu bar should be Help and Window should be one
// to the left of that.
int iMenu = pMenu->GetMenuItemCount() - 2;
// If this assertion fails, your menu bar does not follow the guidelines
// so you will have to override this function and call CreateClient
// appropriately or use the MFC V2 MDI functionality.
ASSERT(iMenu >= 0);
pMenu = pMenu->GetSubMenu(iMenu); //这里返回NULL
ASSERT(pMenu != NULL);
}
return CreateClient(lpcs, pMenu);
}
如何解决以上的问题