Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Menu-problems in CDialog-based application

Posted on 1997-09-14
2
Medium Priority
?
672 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 800 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

824 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