-
July 13th, 2010, 01:25 PM
#1
MFC Menus are confusing
Hello wonderful people who help others,
I am building a GUI in MFC, and I am having a hard time figuring out how to make a menu item open up a modeless dialog window thingy. The menu item has a unique ID, and the dialog has been created, but I am having the toughest time figuring out how to link the two. The project is an MFC application in Visual Studio named test1. I know that I have to call the function "Create" somewhere, and I have to put the event handler "ON_COMMAND(ID_MENUID, someFunctionSomeHow)" in test1.cpp - but where exactly I put everything and how I might have to change my dialog's class to be modeless is beyond me.
I have been all around the internet, and it has only served to confuse me. I am an absolute beginner with MFC and Visual C++, so please use small words and big paragraphs. I am lost and scared and I could use the help of someone with experience doing these kinds of things.
Please and thank you,
Jack
-
July 13th, 2010, 01:30 PM
#2
Re: MFC Menus are confusing
This first step is to set up the event handler for your menu item. Go to the resource edit, right click on your menu item and select "Add Event Handler".
-
July 16th, 2010, 12:57 PM
#3
Re: MFC Menus are confusing
I assume there is more to it than that...and what class do i select from the class list when adding the event handler?
-
July 16th, 2010, 01:02 PM
#4
Re: MFC Menus are confusing
Originally Posted by jack_ftw
I assume there is more to it than that...and what class do i select from the class list when adding the event handler?
Whichever class you want to handle the menu click.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|