1. 程式人生 > >MFC 訊息對映巨集的單純展開(無解析)

MFC 訊息對映巨集的單純展開(無解析)

MFC訊息對映巨集的展開

BEGIN_MESSAGE_MAP (CMainWindow, CFrameWnd)
ON_WM_PAINT () //WM_PAINT 訊息通過MFC的訊息對映機制轉換為對CMainWindow::OnPaint函式的呼叫
END_MESSAGE_MAP ()

展開後

__pragma(warning(push))
__pragma(warning(disable : 4867))

const struct AFX_MSGMAP* CMainWindow::GetMessageMap() const
{	
	return GetThisMessageMap
(); } const struct AFX_MSGMAP* __stdcall CMainWindow::GetThisMessageMap() { typedef CMainWindow ThisClass; typedef CFrameWnd TheBaseClass; __pragma(warning(push)) __pragma(warning(disable: 4640)) static const struct AFX_MSGMAP_ENTRY _messageEntries[] = { WM_PAINT, 0, 0, 0, AfxSig_vv, {(AFX_PMSG)
(AFX_PMSGW)(static_cast<void (AFX_MSG_CALL CWnd::*)(void> (&ThisClass::OnPaint))}, {0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 } }; __pragma(warning(pop)) static const struct AFX_MSGMAP messageMap = { &TheBaseClass::GetThisMessageMap, &_messageRntries[0] }; return &messageMap;
} __pragma(warning(pop))