Both parts are required to add a message handler to the class. A message map must be declared inside your class along with declarations for any message handler functions (for example, OnSize).
class CClassWnd : public CBaseClassWnd {
...
afx_msg void OnSize(UINT nType, int cx, int cy);
DECLARE_MESSAGE_MAP
};
afx_msg - it's just an empty placeholder macro - it actually does nothing, but is always included in the agreement.
.cpp :
BEGIN_MESSAGE_MAP(CClassWnd, CBaseClassWnd)
ON_WM_SIZE()
END_MESSAGE_MAP()
, , , . ON_WM_SIZE wParam lParam WM_SIZE (nType, cx cy ). MFC (WM_LBUTTONDOWN, WM_DESTROY ..).
, MFC MSDN.