Click to See Complete Forum and Search --> : Enabling Menu Item in Main Menu?


Roberto Tedesco
May 4th, 1999, 02:35 PM
I am trying to enable a menu item in the main menu bar.
I have a created a handler for the menu item in CMainFrame and have tried to call pMenu->EnableMenuItem(itemID, MF_BYCOMMAND|MF_GRAYED); and this doesn't seem to work.
However, calling pMenu->CheckMenuItem(itemID, MF_BYCOMMAND, MF_CHECKED) will put a checkmark next to the menu item.
I know this is a simple problem, please enlighten me with a possible solution?
Thanks,
Roberto

May 4th, 1999, 02:42 PM
Hi Roberto:

You should add ON_UPDATE_UI commands for your menus. There you can enable or disable menu items.
You should also put your CheckMenuItem logic in that same handler. Do a search in your Online Documentation for CCmdUI.

Regards,

Francisco J. Novas