Solved

Dialog-based MFC apps and menus

Posted on 1999-01-04
6
257 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel Use VBA to get user's Mac Address for their computer 5 323
Change owner from userA to server Local Administrators 7 71
withoutTen challenge 14 137
matchUp  challenge 9 123
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

685 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