ตัวอย่างจุดเชื่อมต่อ

ตัวอย่างนี้แสดงวัตถุที่สนับสนุน IPropertyNotifySinkเป็นอินเทอร์เฟซที่ขาออก

คลา CConnect: nbsp สาธารณะ CComObjectRootEx <CComObjectThreadModel>
   สาธารณะ CComCoClass < CConnect และ CLSID_CConnect >
   สาธารณะ IConnectionPointContainerImpl <CConnect>
   สาธารณะ IConnectionPointImpl < CConnect และ IID_IPropertyNotifySink >
{
สาธารณะ:
   ...
   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()

...
}

หมายเหตุnbsp  เมื่อระบุIPropertyNotifySinkเป็นอินเทอร์เฟซที่ขาออก คุณสามารถใช้คลาIPropertyNotifySinkCPแทนIConnectionPointImpl ตัวอย่างเช่น(&N):

คลา CConnect: nbsp สาธารณะ CComObjectRootEx <CComObjectThreadModel>
   สาธารณะ CComCoClass < CConnect และ CLSID_CConnect >
   สาธารณะ IConnectionPointContainerImpl <CConnect>
   สาธารณะ IPropertyNotifySinkCP <CConnect>
{
   ...
}

Index