Home COM GDI+ WebBrowser Data Access

IConnectionPoint Interface

 

IID_IConnectionPoint

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

 

 

The IConnectionPoint 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

A client can use the IConnectionPointContainer interface:

  • To obtain access to an enumerator sub-object with the IEnumConnectionPoints interface. The IEnumConnectionPoints interface can then be used to enumerate connection points for each outgoing IID.
     

  • To obtain access to connection point sub-objects with the IConnectionPoint interface for each outgoing 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 that it knows about.

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IConnectionPoint Methods

Description

GetConnectionInterface

Returns the IID of the outgoing interface managed by this connection point.

GetConnectionPointContainer

Returns the parent (connectable) object's IConnectionPointContainer interface pointer.

Advise

Creates a connection between a connection point and a client's sink, where the sink implements the outgoing interface supported by this connection point.

Unadvise

Terminates a notification previously set up with Advise.

EnumConnections

Returns an object to enumerate the current advisory connections for this connection point.

 

QueryInterface

 

FUNCTION IConectionPoint_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 IConnectionPoint_QueryInterface (pthis, riid, ppvObj) TO HRESULT
  FUNCTION = HRESULT
 

END FUNCTION

 

 

 

FUNCTION IConnectionPoint_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 IConnectionPoint_AddRef ( _

  BYVAL pthis AS DWORD PTR _

  ) AS DWORD
 

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

END FUNCTION

 

 

 

FUNCTION IConnectionPoint_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 IConnectionPoint_Release (pthis) TO   DWRESULT
  FUNCTION = DWRESULT
 

END FUNCTION

 

 

 

FUNCTION IConnectionPoint_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

 

 

GetConnectionInterface

 

FUNCTION IConnectionPoint_GetConnectionInterface ( _

  BYVAL pthis AS DWORD PTR _

, BYREF pIID AS GUID _

  ) AS LONG

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

END FUNCTION

 

 

 

FUNCTION IConnectionPoint_GetConnectionInterface ( _

  BYVAL pthis AS DWORD PTR _

, BYREF pIID AS GUID _

  ) AS LONG

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


END FUNCTION

 

 

GetConnectionPointContainer

 

FUNCTION IConnectionPoint_GetConnectionPointContainer ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppCPC AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING IConnectionPoint_GetConnectionPointContainer (pthis, ppCPC) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IConnectionPoint_GetConnectionPointContainer ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppCPC AS DWORD _

  ) AS LONG

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


END FUNCTION

 

 

Advise

 

FUNCTION IConnectionPoint_Advise ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pUnkSink AS DWORD _

, BYREF pdwCookie AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[5] USING IConnectionPoint_Advise (pthis, pUnkSink, pdwCookie) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION
 

 

 

FUNCTION IConnectionPoint_Advise ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pUnkSink AS DWORD _

, BYREF pdwCookie AS DWORD _

  ) AS LONG

  ! push pdwCookie

  ! push pUnkSink
  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+20]
  ! 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 = IUmknown_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
 

 

Unadvise

 

FUNCTION IConnectionPoint_Unadvise ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL dwCookie AS DWORD _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[6] USING IConnectionPoint_Unadvise (pthis, dwCookie) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

 

FUNCTION IConnectionPoint_Unadvise ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL dwCookie AS DWORD _

  ) AS LONG

  ! push dwCookie

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


END FUNCTION

 

 

Example

 

FUNCTION AtlUnadvise ( _

  BYVAL pUnkCP AS DWORD PTR _

, BYREF iid AS GUID _

, BYVAL dw 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_Unadvise(pCP, dw)

     END IF

  END IF
  FUNCTION = hr

END FUNCTION
 

 

EnumConnections

 

FUNCTION IConnectionPoint_EnumConnections ( _

  BYVAL pthis AS DWORD PTR _

, BYREF ppenum AS DWORD _

  ) AS LONG

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

END FUNCTION

 

 

 

FUNCTION IConnectionPoint_EnumConnections ( _

  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+28]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

Page last updated on Friday, 17 March 2006 21:36:23 +0100