接口映射表的宏定义 #define begin interFace map(the class, the base)\ const AFX INTERFACEMAP* PASCAL the Class: GetBaselnterfaceMap0\ f return &the Base: interface Map; )I const AFX INTERFACEMAP* the Class: GetInterfaceMap(0 const f return &the Class: interface Map; I AFX COMDAT const AFX DATADEF AFX INTERFACEMAP the Class: interfaceMap=\ [&the Class: Get BaseInterface Map, &the Class: interface Entries(01,; I AFX COMDAT const AFX DATADEF AFX INTERFACEMAP ENTRY the Class: interface Entries[=I #define INTERFACE Part(the Class, id, localClass)\ [&id, offsetof( the Class, m x##localClass)), I #define END INTERFACE MAPO I (NULL, (size t)-1) };接口映射表的宏定义 #define BEGIN_INTERFACE_MAP(theClass, theBase) \ const AFX_INTERFACEMAP* PASCAL theClass::_GetBaseInterfaceMap() \ { return &theBase::interfaceMap; } \ const AFX_INTERFACEMAP* theClass::GetInterfaceMap() const \ { return &theClass::interfaceMap; } \ AFX_COMDAT const AFX_DATADEF \ AFX_INTERFACEMAP theClass::interfaceMap = \ { &theClass::_GetBaseInterfaceMap, &theClass::_interfaceEntries[0], }; \ AFX_COMDAT const AFX_DATADEF AFX_INTERFACEMAP_ENTRY theClass::_interfaceEntries[] = \ { \ #define INTERFACE_PART(theClass, iid, localClass) \ { &iid, offsetof(theClass, m_x##localClass) }, \ #define END_INTERFACE_MAP() \ { NULL, (size_t)-1 } \ }; \