Declares that the class defines a message map. Each CCmdTarget-derived class in your program must provide a message map to handle messages.
DECLARE_MESSAGE_MAP( )
Remarks
Use the DECLARE_MESSAGE_MAP macro at the end of your class declaration. Then, in the .cpp file that defines the member functions for the class, use the BEGIN_MESSAGE_MAP macro, macro entries for each of your message-handler functions, and the END_MESSAGE_MAP macro.
Note |
|---|
| If you declare any member after DECLARE_MESSAGE_MAP, you must specify a new access type (public, private, or protected) for them. |
For more information on message maps and the DECLARE_MESSAGE_MAP macro, see Message Handling and Mapping Topics.
本文介绍MFC中DECLARE_MESSAGE_MAP宏的使用方法。该宏用于声明类的消息映射,确保每个派生于CCmdTarget的类都能处理消息。文章通过示例展示了宏在类声明中的位置及配合BEGIN_MESSAGE_MAP和END_MESSAGE_MAP宏使用的正确方式。
Note
6116

被折叠的 条评论
为什么被折叠?



