Beispiel einer Verbindung Punkt

Dieses Beispiel zeigt ein Objekt, das unterstützt IPropertyNotifySink als eine Ausgangsschnittstelle

klasse schließen: Nbsp; öffentliche CComObjectRootEx <CComObjectThreadModel>,
   öffentliche CComCoClass < schließen & CLSID_CConnect >
   öffentliche IConnectionPointContainerImpl <CConnect>,
   öffentliche IConnectionPointImpl < schließen & IID_IPropertyNotifySink >
{
Öffentliche:
   ...
   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()

...
}

Hinweis&Nbsp;  Wenn Sie IPropertyNotifySink als eine Ausgangsschnittstelle angeben, können Sie anstelle von IConnectionPointImplKlasse IPropertyNotifySinkCP . Zum Beispiel:

klasse schließen: Nbsp; öffentliche CComObjectRootEx <CComObjectThreadModel>,
   öffentliche CComCoClass < schließen & CLSID_CConnect >
   öffentliche IConnectionPointContainerImpl <CConnect>,
   öffentliche IPropertyNotifySinkCP <CConnect>
{
   ...
}

Index