Solved

Menu-problems in CDialog-based application

Posted on 1997-09-14
2
645 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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…
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…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 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