MFC版本的字典对象类实现 STDMETHODIMP (ULONG) CDictionary: XDictionary: AddRefo METHOD PROLOGUE EX(CDictionary, Dictionary) return pThis->ExternalAddRef0; METHOD PROLOGUE EX宏定义: #define METHOD PROLOGUE EX(the Class, localClass)\ the Class* pThis=((the Class ")(BYTE*)this-m oFfset); AFX MANAGE STATE(PThis->m pModule State)\ pThis; // avoid warning from compiler IMFC版本的字典对象类实现 STDMETHODIMP_(ULONG) CDictionary::XDictionary::AddRef() { METHOD_PROLOGUE_EX_(CDictionary, Dictionary) return pThis->ExternalAddRef(); } • METHOD_PROLOGUE_EX_宏定义: #define METHOD_PROLOGUE_EX(theClass, localClass) \ theClass* pThis = ((theClass*)((BYTE*)this - m_nOffset)); \ AFX_MANAGE_STATE(pThis->m_pModuleState) \ pThis; // avoid warning from compiler \