Implement IConnectionPointContainer on an object extending from COleDocument (instead of COleControl)
Has anybody had any experience with COM / MFC trying to implement IConnectionPointContainer on an object extending from COleDocument (instead of COleControl) ? Can somebody please provide any tips, or a pointer to a guide on how to do this ? I need to implement notifications for objects that list开发者_如何学Pythonen to changes to the document, which are made as part of implementations of another interface which is implemented by the Document.
MFC connection macros are not specific to COleControl but CCmdTarget. You can use DECLARE_CONNECTION_MAP/BEGIN_CONNECTION_MAP etc as long as your class is derived from CCmdTarget, and in this case, COleDocument is.
Suggested reading:
TN038: MFC/OLE IUnknown Implementation
Connpts.exe sample demonstrates how to implement connection points and connection point sinks in Visual C++
精彩评论