Link to home
Start Free TrialLog in
Avatar of clintonJ
clintonJ

asked on

Disabling a menu item on a dialog menu

I have an VC 6.0 app.  In design time, I created a menu on the main dialog.  The resource ID is IDR_MAINFRAME.  Like many windows programs, this menu has three menus.  From left to right, the menus are "File", "View", and "Help".  On my "View" menu, I want to be able to enable/disable the fourth menu item, during runtime, depending on the user's input.

I've tried processing the ON_UPDATE_COMMAND_UI message for the menu item, but my message handler function is never getting called.  If I use the resource ID of the first menu item in the "View" menu,  in connection with ON_UPDATE_COMMAND_UI.  In this case, my message handler function DOES get called.  But then how do I reference the fourth menu item?

Thanks ahead of time.
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of clintonJ
clintonJ

ASKER

Sometimes I get tripped up by the obivous.  :0  The message handler for the ON_UPDATE_COMMAND_UI message was already implemented when I inherited this code.  I didn't realize this.  Thus, the original author's message handler function was getting called, which of course was preventing mine from getting called.