Exemple de Point de connexion

Cet exemple montre un objet qui prend en charge la IPropertyNotifySink comme interface sortante

classe CConnect : nbsp ; CComObjectRootEx public <CComObjectThreadModel>,
   public CComCoClass < CConnect, & CLSID_CConnect >,
   IConnectionPointContainerImpl public <CConnect>,
   public IConnectionPointImpl < CConnect, & IID_IPropertyNotifySink >
{
public :
   ...
   BEGIN_COM_MAP(CConnect)
      COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
   END_COM_MAP()

BEGIN_CONNECTION_POINT_MAP(CConnect)
      CONNECTION_POINT_ENTRY(IID_IPropertyNotifySink)
   END_CONNECTION_POINT_MAP()

...
}

&Notenbsp ;  Lorsque vous spécifiez IPropertyNotifySink comme interface sortante, vous pouvez utiliser la classe IPropertyNotifySinkCP au lieu de IConnectionPointImpl. Par exemple:

classe CConnect : nbsp ; CComObjectRootEx public <CComObjectThreadModel>,
   public CComCoClass < CConnect, & CLSID_CConnect >,
   IConnectionPointContainerImpl public <CConnect>,
   IPropertyNotifySinkCP public <CConnect>
{
   ...
}

Index