MFC Menus are confusing
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: MFC Menus are confusing

  1. #1
    Join Date
    Jul 2010
    Posts
    2

    Unhappy 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

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,120

    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".

  3. #3
    Join Date
    Jul 2010
    Posts
    2

    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?

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,120

    Re: MFC Menus are confusing

    Quote Originally Posted by jack_ftw View Post
    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center