Solved

Menu-problems in CDialog-based application

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 53
Error on moodle after upgrade 3 123
Fibonacci challenge 11 110
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 76
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

16 Experts available now in Live!

Get 1:1 Help Now