Solved

Dialog-based MFC apps and menus

Posted on 1999-01-04
6
253 Views
Last Modified: 2013-11-20
I created, in VC++ 6.0, a dialog based MFC app. I want to use a menu in my dialog, only I do not know what parameter I should switch. I cannot find a dialog function anywhere. If this is too complicated, I would instead prefer to write a Win32 app without a window... just with a dialog procedure. How would I do this? Thanks.
0
Comment
Question by:SuperMario
  • 3
  • 2
6 Comments
 
LVL 3

Author Comment

by:SuperMario
ID: 1327196
I would really like just some working Dialog Box creation code. I know how to do it, but it will not run in VC++ because I don't have enough experience yet and I goofed up somewhere. However, I know it would be easier in MFC to implement a menu in a dialog box. Please supply me with the answer to the least difficult question. Thank you!
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1327197
Use SetMenu (member of CWnd - the base class of CDialog) to set a menu into your dialog.

The SetMenu function requires a CMenu, so you'll need to construct one of these including loading the menu from your resources.

The Menus send WM_COMMAND messages to your dialog proc/class.

The menu functions for a window/dialog are the same - and are members of CWnd
0
 
LVL 2

Expert Comment

by:wyy_cq
ID: 1327198
when you edit the dialog resource , you can set the menu of the dialog.
Open the dialog properties , and select the menu-ID in the comboBox .

the menu will appears when your application open it and will not appear when you test it in VC Studio .
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 3

Author Comment

by:SuperMario
ID: 1327199
I mean, in MFC, there IS no dialog procedure OR window procedure. It is all classes. I would much rather have some code that would just create a dialog box... no window. I would raise the points but I only have 50. Sorry. I need code with a dialog procedure in it with the UINT parameter. PLZ help!
0
 
LVL 3

Author Comment

by:SuperMario
ID: 1327200
I know how to do that, I need to know how to manipulate the menu and where I switch the UINT parameter in all that class stuff. I don't see any window or dialog procedure in all my MFC code.
0
 
LVL 2

Accepted Solution

by:
wyy_cq earned 50 total points
ID: 1327201
what are you want to do ? add menu to dialog or see the procedure of window .

if it is important to see the windowProc the easiest way is to subclass the window procedure with your own WndProc .

::SetWindowLong(dlg.GetSafeHwnd()......); can subclass the windowProc of the dlg object.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 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

22 Experts available now in Live!

Get 1:1 Help Now