Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dialog-based MFC apps and menus

Posted on 1999-01-04
6
Medium Priority
?
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: 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 100 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

730 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