VS2010 CDialog 不能响应 UPDATE_COMMAND_UI
重载CDialog 的ContinueModal()虚函数
添加如下代码:
1 CCmdUI cmdUI; 2 for (int n = 0; n < m_Menu.GetMenuItemCount(); ++n) 3 { 4 CMenu* pSubMenu = m_Menu.GetSubMenu(n); 5 cmdUI.m_nIndexMax = pSubMenu->GetMenuItemCount(); 6 for (int i = 0; i < cmdUI.m_nIndexMax;++i) 7 { 8 cmdUI.m_nIndex = i; 9 cmdUI.m_nID = pSubMenu->GetMenuItemID(i); 10 cmdUI.m_pMenu = pSubMenu; 11 cmdUI.DoUpdate(this, FALSE); 12 } 13 }