[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.
LWSTDAPI ConnectToConnectionPoint( IUnknown *punk, REFIID riidEvent, BOOL fConnect, IUnknown *punkTarget, DWORD *pdwCookie, IConnectionPoint **ppcpOut );
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.
The IID of the interface on the connection point container whose connection point object is being requested.
TRUE if a connection is being established; FALSE if a connection is being broken.
A pointer to the connection point container's IUnknown interface.
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.
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.
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
|Minimum supported client||Windows 2000 Professional, Windows XP [desktop apps only]|
|Minimum supported server||Windows 2000 Server, Windows Server 2003 [desktop apps only]|
|DLL||Shlwapi.dll (version 5.0 or later)|