MFC版本的字典对象类定义 class CDictionary public CCmdTarget DECLARE DYNCREATE(CDictionary CDictionary0; /protected constructor used by dynamic creation DECLARE INTERFACE MAPO ∥ Dictionary BEGIN INTERFACE PART(Dictionary, IDictionary INIT_ INTERFACE PART(CDictionary, Dictionary) STDMETHOD(BOOL, Initialize)0; STDMETHOD_ (void, FreeLibrary)0 END INTERFACE PART STATIC(Dictionary) ∥ SPellcHeck BEGIN INTERFACE PART(SpellCheck, ISpellCheck INIT INTERFACE PART(CDictionary, SpellCheck STDMETHOD(BOOL, Check Word)(LPOLESTR, LPOLESTR") END INTERFACE PART STATIC(SpellCheck)MFC版本的字典对象类定义 class CDictionary : public CCmdTarget { DECLARE_DYNCREATE(CDictionary) CDictionary(); // protected constructor used by dynamic creation DECLARE_INTERFACE_MAP() ...... // IDictionary BEGIN_INTERFACE_PART(Dictionary, IDictionary) INIT_INTERFACE_PART(CDictionary, Dictionary) STDMETHOD_(BOOL, Initialize)(); …… STDMETHOD_(void, FreeLibrary)(); END_INTERFACE_PART_STATIC(Dictionary) // ISpellCheck BEGIN_INTERFACE_PART(SpellCheck, ISpellCheck) INIT_INTERFACE_PART(CDictionary, SpellCheck) STDMETHOD_(BOOL, CheckWord)(LPOLESTR, LPOLESTR *); END_INTERFACE_PART_STATIC(SpellCheck) };