Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
MFC
TRY
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

DECLARE_MESSAGE_MAP 

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( )

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.

NoteNote

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.

// Example for DECLARE_MESSAGE_MAP
class CMyWnd : public CFrameWnd
{
    // Member declarations
    
    DECLARE_MESSAGE_MAP( )
};

Community Additions

ADD
Show:
© 2015 Microsoft