END_MSG_MAP
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

END_MSG_MAP

Marks the end of a message map.

END_MSG_MAP( )

Remarks

Always use the BEGIN_MSG_MAP macro to mark the beginning of a message map. Use ALT_MSG_MAP to declare subsequent alternate message maps.

Note that there is always exactly one instance of BEGIN_MSG_MAP and END_MSG_MAP.

For more information about using message maps in ATL, see Message Maps.

Example

The following example shows the default message map and one alternate message map, each containing one handler function:

BEGIN_MSG_MAP(CMyClass)
   MESSAGE_HANDLER(WM_PAINT, OnPaint)
ALT_MSG_MAP(1)
   MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
END_MSG_MAP()

The next example shows two alternate message maps. The default message map is empty.

BEGIN_MSG_MAP(CMyClass)
ALT_MSG_MAP(1)
   MESSAGE_HANDLER(WM_PAINT, OnPaint)
   MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
ALT_MSG_MAP(2)
   MESSAGE_HANDLER(WM_CREATE, OnCreate)
END_MSG_MAP()

See Also

Message Map Macros | ATL Macros

Show:
© 2016 Microsoft