[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Disabling a menu item on a dialog menu

Posted on 2008-06-20
2
Medium Priority
?
1,152 Views
Last Modified: 2013-12-14
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.
0
Comment
Question by:clintonJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 2000 total points
ID: 21835191
it should work, no matters if it is the first or fourth.
maybe you missed something, is the function correctly declared and implemented? like:

void CYourMainDlg::OnUpdateYourFunction(CCmdUI* pCmdUI)
{
}

also, how do you determine it is called? are you sure of that?
0
 

Author Closing Comment

by:clintonJ
ID: 31469332
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.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question