Command messages for FrameWindow member objects - Programmer

This is a discussion on Command messages for FrameWindow member objects - Programmer ; Dear all, i am working on an SDI application and in that application i need to broadcast a message to all the objects. So i used: SendMessage(WM_COMMAND, ID_SOMEID); // From within the document object Then i added ON_COMMAND_EX macros in ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Command messages for FrameWindow member objects

  1. Command messages for FrameWindow member objects

    Dear all,

    i am working on an SDI application and in that application i need to
    broadcast a message to all the objects. So i used:

    SendMessage(WM_COMMAND, ID_SOMEID); // From within the document object

    Then i added ON_COMMAND_EX macros in various objects for handling and
    further passing the message. I realized that MainFrame object was
    getting the message but a dialog bar object which is a member of
    MainFrame was not getting this message. I tried a lot but couldnt
    figure out why dialog bar object is not getting my command message when
    it is getting other command messages and update UI command messages.
    Can anyone give a clue what wrong with it?

    I am using Visual Studio .NET 2002 and offcourse i am returning FALSE
    from ON_COMMAND_EX handler funtions.

    Thanks in advance
    Hemant


  2. Re: Command messages for FrameWindow member objects

    Hallo Hemant Jangid!

    > i am working on an SDI application and in that application i need to
    > broadcast a message to all the objects. So i used:
    >
    > SendMessage(WM_COMMAND, ID_SOMEID); // From within the document object
    >
    > Then i added ON_COMMAND_EX macros in various objects for handling and
    > further passing the message. I realized that MainFrame object was
    > getting the message but a dialog bar object which is a member of
    > MainFrame was not getting this message. I tried a lot but couldnt
    > figure out why dialog bar object is not getting my command message when
    > it is getting other command messages and update UI command messages.
    > Can anyone give a clue what wrong with it?


    This is obviuos because there is a strict rule how Command messages are
    routed. Read the technical note TN021:
    http://msdn.microsoft.com/library/en...otes_tn021.asp


    --
    Martin Richter [MVP] WWJD
    "In C we had to code our own bugs. In C++ we can inherit them."
    FAQ : http://www.mpdvc.de
    Samples: http://www.codeguru.com http://www.codeproject.com

  3. Re: Command messages for FrameWindow member objects

    Hello Martin,

    I have gone throught that article but unfortunately i couldnt solve my
    problem (perhaps because i am not MVP). Few lines from that article
    which i found more important are:

    "The command architecture of routing and enabling commands works well
    with frame windows, menu items, toolbar buttons, dialog bar buttons,
    other control bars and other user-interface elements designed to update
    on demand and route commands or control IDs to a main command target
    (usually the main frame window). That main command target may route the
    command or control notifications to other command target objects as
    appropriate."

    So it says that bydefault my poor dialog bar will get command messages
    only for user-interface elements (i guess these are dialog bar
    controls) and MainFrame will send other commands only if it finds
    ^appropriate^.

    What should i do so that MainFrame finds it appropriate to send custom
    commands to dialogbar.

    Thanks for reponse,
    Hemant Jangid

    P.S. I checked the FAQ link given in your eMail signature and it was
    good to see a FAQ site with rich content. How can i get it in english?


+ Reply to Thread