CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Posts
    128

    routing command messages

    this is probably not beginner stuff but i couldn't think of any other place it belongs.

    Anyway, i have a dialog bar based on a derived CDialogBar class and a command handler in the MainFrame for a button on this dialog bar.

    This all works ok, but now i want to also handle the same button click in the derived CDialogBar class to do some pre-processing before the main frame gets it. but it dont work! the command message seems to get consumed by the first handler the framework finds for it, which in this case is the CDialogBar derived class, and the main frame never gets the message.

    so, what i'm trying to say is can i continue routing a command meesage through the rest of the framework even after i've handled it in a particular class?



  2. #2
    Join Date
    May 1999
    Posts
    44

    Re: routing command messages

    Have you tried

    ON_MESSAGE(WM_COMMAND, ID_MYCOMMAND, OnMyCommand)

    instead of

    ON_COMMAND(ID_MYCOMMAND, ...)

    If OnMyCommand returns 0, the message should be sent back to the frame.


  3. #3
    Join Date
    May 1999
    Posts
    128

    Re: routing command messages

    thanks! you got me pointed in the right direction and i found an even easier way using ON_COMMAND_EX. This allows the handler to return FALSE if you want to continue routing the message.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured