MDI程序的部分主菜单命令是灰色的
我有一个MDI程序,主菜单CMainFrm的命令多数放在主视窗CMyprogView中,这部分命令全部是灰色的(无效),而2个实现函数放在CMainFrm中的命令就可以,这是什么原因?难道MDI程序的菜单命令一定要放在主框架中吗?
[解决办法]
Details see the CWnd::OnInitMenuPopup source code
..\Visual studio\VC98\mfc\src
Menu initialization is automatic in the framework, occurring when the application receives a WM_INITMENUPOPUP message. During the idle loop, the framework searches the command routing for button update handlers in much the same way as it does for menus.