Share via


END_MSG_MAP

 

Marks the end of a message map.

Syntax

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

Requirements

Header: atlwin.h

See Also

Message Map Macros (ATL)
ATL Macros