ON_COMMAND()
ON_MESSAGE()
映射消息有什么不同?

解决方案 »

  1.   

    This macro maps a command message to a member function.ON_COMMAND(id, memberFxn )
    Parameters
    id 
    The command ID. 
    memberFxn 
    The name of the message-handler function to which the command is mapped. 
    Res
    It indicates which function will handle a command message from a command user-interface object such as a menu item or toolbar button. When a command-target object receives a Windows WM_COMMAND message with the specified ID, ON_COMMAND will call the member function memberFxn to handle the message.Use ON_COMMAND to map a single command to a member function. Use ON_COMMAND_RANGE to map a range of command ids to one member function. Only one message-map entry can match a given command id. That is, you can't map a command to more than one handler. For more information and examples, see Message Handling and Mapping Topics.Indicates which function will handle a user-defined message.ON_MESSAGE(message, memberFxn )
    Parameters
    message 
    The message ID. 
    memberFxn 
    The name of the message-handler function to which the message is mapped. 
    Res
    User-defined messages are usually defined in the range WM_USER to 0x7FFF. User-defined messages are any messages that are not standard Windows WM_MESSAGE messages. There should be exactly one ON_MESSAGE macro statement in your message map for every user-defined message that must be mapped to a message-handler function.
      

  2.   

    前者处理标准windows消息,如相应按钮,菜单选项,后者是处理非标准信息,即用户自定义消息,如用户在某个地方要自已post一个消息,该消息对应一个成员函数
      

  3.   

    前者处理标准windows消息,如相应按钮,菜单选项,后者是处理非标准信息,即用户自定义消息,如用户在某个地方要自已post一个消息,该消息对应一个成员函数
      

  4.   

    是这样的。完全同意aoosang()