Solved

Dialog-based MFC apps and menus

Posted on 1999-01-04
6
255 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

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.
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 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