Home COM GDI+ WebBrowser Data Access

IConnectionPointContainer Interface

 

IID_IConnectionPointContainer

{B196B284-BAB4-101A-B69C-00AA00341D07}

 

 

The IConnectionPointContainer interface supports connection points for connectable objects.

 

Connectable objects support the following features:

  • Outgoing interfaces, such as event sets

  • The ability to enumerate the IIDs of the outgoing interfaces

  • The ability to connect and disconnect sinks to the object for those outgoing IIDs

  • The ability to enumerate the connections that exist to a particular outgoing interface

Through IConnectionPointContainer, you can locate a specific connection point for one IID or obtain an enumerator to enumerate the connections points.

 

Use the IConnectionPointContainer interface to obtain access to:

  • Enumerator sub-objects with the IEnumConnectionPoints interface. The IEnumConnectionPoints interface can then be used to enumerate connection points for each outgoing IID.
     

  • Connection point sub-objects with the IConnectionPoint interface for each IID. Through the IConnectionPoint interface, a client starts or terminates an advisory loop with the connectable object and the client's own sink. The client can also use the IConnectionPoint interface to obtain an enumerator object with the IEnumConnections interface to enumerate the connections it knows about.

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IConnectionPointContainer Methods

Description

EnumConnectionPoints

Returns an object to enumerate all the connection points supported in the connectable object.

FindConnectionPoint

Returns a pointer to the IConnectionPoint interface for a specified connection point.

 

QueryInterface

 

FUNCTION IConectionPointContainer_QueryInterface ( _

  BYVAL pthis AS DWORD PTR _

, BYREF riid AS GUID _

, BYREF ppvObj AS DWORD _

  ) AS LONG


  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[0] USING IConnectionPointContainer_QueryInterface (pthis, riid, ppvObj) TO HRESULT
  FUNCTION = HRESULT
 

END FUNCTION

 

 

 

FUNCTION IConectionPointContainer_QueryInterface ( _
  BYVAL pthis AS DWORD PTR _
, BYREF riid AS GUID _
, BYREF ppvObj AS DWORD _
  ) AS LONG

  ! push ppvObj
  ! mov  eax, riid
  ! push eax
  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

AddRef

 

FUNCTION IConnectionPointContainer_AddRef ( _

  BYVAL pthis AS DWORD PTR _

  ) AS DWORD
 

  LOCAL DWRESULT AS LONG
  CALL DWORD @@pthis[1] USING IConnectionPointContainer_AddRef (pthis) TO DWRESULT
  FUNCTION = DWRESULT
 

END FUNCTION

 

 

 

FUNCTION IConnectionPointContainer_AddRef ( _

  BYVAL pthis AS DWORD PTR _

  ) AS DWORD
 

  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+4]
  ! mov  FUNCTION, eax

 

END FUNCTION

 

 

Release

 

FUNCTION IConnectionPoint_Release ( _

  BYVAL pthis AS DWORD PTR _

  ) AS DWORD
 

  LOCAL DWRESULT AS DWORD
  CALL DWORD @@pthis[2] USING IConnectionPointContainer_Release (pthis) TO   DWRESULT
  FUNCTION = DWRESULT
 

END FUNCTION

 

 

 

FUNCTION IConectionPointContainer_Release ( _

  BYVAL pthis AS DWORD PTR _

  ) AS DWORD
 

  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+8]
  ! mov  FUNCTION, eax

 

END FUNCTION

 

 

IEnumConnectionPoints

 

FUNCTION IConnectionPointContainer_EnumConnectionPoints ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppenum AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[3] USING IConnectionPointContainer_EnumConnectionPoints (pthis, ppenum) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IConnectionPointContainer_EnumConnectionPoints ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppenum AS DWORD _

  ) AS LONG

 

  ! push ppenum
  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+12]
  ! mov  FUNCTION, eax

 

END FUNCTION

 

 

FindConnectionPoint

 

FUNCTION IConnectionPointContainer_FindConnectionPoint ( _

  BYVAL pthis AS DWORD PTR _

, BYREF riid AS GUID _

, BYREF ppCP AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING IConnectionPointContainer_FindConnectionPoint (pthis, riid, ppCP) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IConnectionPointContainer_FindConnectionPoint ( _

  BYVAL pthis AS DWORD PTR _

, BYREF riid AS GUID _

, BYREF ppCP AS DWORD _

  ) AS LONG

  ! push ppCP

  ! mov  eax, riid
  ! push eax
  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+16]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

Example

 

FUNCTION AtlAdvise ( _

  BYVAL pUnkCP AS DWORD PTR _

, BYVAL pUnk AS DWORD _

, BYREF iid AS GUID _

, BYREF pdw AS DWORD _

  ) AS LONG

  LOCAL hr AS LONG
  LOCAL pCPC AS DWORD

  LOCAL pCP AS DWORD

  LOCAL IID_IConnectionPointContainer AS GUID

  IID_IConnectionPointContainer = GUID$("{B196B284-BAB4-101A-B69C-00AA00341D07}")

  IF punkCP = %NULL THEN

     FUNCTION = %E_INVALIDARG

     EXIT FUNCTION

  END IF

  hr = IUnknown_QueryInterface(pUnkCP, IID_IConnectionPointContainer, pCPC)

  IF SUCCEEDED(hr) THEN

     hr = IConnectionPointContainer_FindConnectionPoint(pCPC, iid, pCP)

     IF SUCCEEDED(hr) THEN

        hr = IConnectionPoint_Advise(pCP, pUnk, pdw)

     END IF

  END IF
  FUNCTION = hr

END FUNCTION
 

 

Page last updated on Monday, 03 April 2006 20:24:49 +0200