Solved

Menu-problems in CDialog-based application

Posted on 1997-09-14
2
617 Views
Last Modified: 2013-11-19
I have a CDialog-based application in which I have attached
a menu to the main dialog. (Both by setting the Menu-
property of the dialog and by explicitly doing CWnd::SetMenu
in my OnInitDialog.)

The menu seems to work OK and the COMMAND message for each
menu-item is correctly sent/called when selected. However,
I have not yet been able to get the UPDATE_COMMAND_UI
message to work.

(I want the UPDATE_COMMAND_UI so that I can implement a
simple MRU-list.)

What is missing to get this working?
0
Comment
Question by:Daniel_E
2 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 200 total points
ID: 1306258
You need to handle WM_INITPOPUPMENU and use basically the same code (copy and paste it) as the MFC CFrameWnd code for OnInitPopupMenu

This code creates a CCmdUi for the menu and calls DoUpdate which doe sall the work for you.

0
 
LVL 1

Author Comment

by:Daniel_E
ID: 1306259
Thanks a lot for the quick answer!

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now