Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

ConnectToConnectionPoint function

[This function is available through Windows XP and Windows Server 2003. It might be altered or unavailable in subsequent versions of Windows.]

Establishes or terminates a connection between a client's sink and a connection point container.

Syntax


HRESULT ConnectToConnectionPoint(
  _In_opt_   IUnknown *punk,
  _In_       REFIID riidEvent,
  BOOL fConnect,
  _In_       IUnknown *punkTarget,
  _Out_      DWORD *pdwCookie,
  _Out_opt_  IConnectionPoint **ppcpOut
);

Parameters

punk [in, optional]

Type: IUnknown*

A pointer to the IUnknown interface of the object to be connected to the connection point container. If you set fConnect to FALSE to indicate that you are disconnecting the object, this parameter is ignored and can be set to NULL.

riidEvent [in]

Type: REFIID

The IID of the interface on the connection point container whose connection point object is being requested.

fConnect

Type: BOOL

TRUE if a connection is being established; FALSE if a connection is being broken.

punkTarget [in]

Type: IUnknown*

A pointer to the connection point container's IUnknown interface.

pdwCookie [out]

Type: DWORD*

A connection token. If you set fConnect to TRUE to make a new connection, this parameter receives a token that uniquely identifies the connection. If you set fConnect to FALSE to break a connection, this parameter must point to the token that you received when you called ConnectToConnectionPoint to establish the connection.

ppcpOut [out, optional]

Type: IConnectionPoint**

A pointer to the connection point container's IConnectionPoint interface, if the operation was successful. The calling application must release this pointer when it is no longer needed. If the request is unsuccessful, the pointer receives NULL. This parameter is optional and can be NULL.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server, Windows Server 2003 [desktop apps only]

Header

Shlwapi.h

DLL

Shlwapi.dll (version 5.0 or later)

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.