mfc多文档解决GetMenu()->GetSubMenu(0)为null,报错问题
将
CMenu* menu;
menu = GetMenu()->GetSubMenu(0);
CMenu* childMenu = menu->GetSubMenu(8);//装载自定义的菜单
改为
CMenu pMenu = CMenu::FromHandle(m_wndMenuBar.GetHMenu());
CMenu menu;
menu = pMenu->GetSubMenu(0);
CMenu* childMenu = menu->GetSubMenu(8);