Thread: Add ON_COMMAND menu button handler

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    34

    Add ON_COMMAND menu button handler

    Hi,

    In VC6 (MFC - SDI - CFormView)... to add a menu button handler:

    open class wizard
    click on the ID_BUTTON_NAME
    click on COMMAND
    click "add function"
    click "edit code"

    In VC7.net (MFC - SDI - CFormView)...
    How do i do the same task, or do i have to add the command handler code manually??

    Please please someone help.... its driving me nuts!


    joe
    #

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Right-click the control (button, etc) you want and select the option to add an event handler.

    Kuphryn

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    34
    Its the toolbar buttons resource.

    If i right-click on them, a menu appears with lots of options for drawing buttons, but no "event handler"


    Joe
    #

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Add these lines to the class interface and implementation files.

    afx void OnMenu(CCmdUI *pCmdUI)
    ON_COMMAND(ID_MENU, OnMenu)

    Kuphryn

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    34

    Thumbs down

    Yeah, i've written the handlers and message mapping manually now, but isn't the idea of a CAD to make life simplier?

    What the hell were MS thinking of? This is stupid and rediculous.

    In a previous version, it was simple, in a newer version, its impossible...

    Don't figure!

    Joe
    #

  6. #6
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    hahahahah

    Remember Microsoft is pushing C#. As far I as I see, Microsoft is not longer improving MFC.

    Kuphryn

  7. #7
    Registered User
    Join Date
    Jul 2002
    Posts
    34
    well, i cant be dealing with this!

    As soon as i find a way to use the nice looking XP style buttons that .net produces, so i can just apply them to my exsisting VC6 projects without changing the code, .net is going on ebay!

    I know there are 3rd party companies out there that sell these, but i've paid for .net, so i'll wait until someone figures out how to do it.

    It cant be anything more complex than copying over the libaries, but i dont know enough about the software to do that!


    Cheers,

    joe
    #
    Last edited by kybert; 09-15-2002 at 08:12 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 06-28-2008, 08:30 PM
  2. Dynamically add statis text to a dialog box
    By earth_angel in forum Windows Programming
    Replies: 8
    Last Post: 06-23-2005, 01:28 PM
  3. disabling button in another prog
    By timmygax in forum Windows Programming
    Replies: 11
    Last Post: 10-29-2001, 03:40 PM
  4. Button Identifier Problems!
    By SyntaxBubble in forum Windows Programming
    Replies: 2
    Last Post: 10-16-2001, 05:48 PM
  5. Unselecting a selected button in C++Builder 5
    By Frozen_solid in forum Windows Programming
    Replies: 4
    Last Post: 09-25-2001, 07:57 PM