description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||
---|---|---|---|---|---|---|---|---|---|
Learn more about: Connection Point Global Functions |
Connection Point Global Functions |
11/04/2016 |
|
|
bcb4bf50-2155-4e20-b8bb-f2908b03a6e7 |
These functions provide support for connection points and sink maps.
Important
The functions listed in the following table cannot be used in applications that execute in the Windows Runtime.
Function | Description |
---|---|
AtlAdvise | Creates a connection between an object's connection point and a client's sink. |
AtlUnadvise | Terminates the connection established through AtlAdvise . |
AtlAdviseSinkMap | Advises or unadvises entries in an event sink map. |
Header: atlbase.h
Creates a connection between an object's connection point and a client's sink.
Important
This function cannot be used in applications that execute in the Windows Runtime.
HRESULT AtlAdvise(
IUnknown* pUnkCP,
IUnknown* pUnk,
const IID& iid,
LPDWORD pdw);
pUnkCP
[in] A pointer to the IUnknown
of the object the client wants to connect with.
pUnk
[in] A pointer to the client's IUnknown
.
iid
[in] The GUID of the connection point. Typically, this is the same as the outgoing interface managed by the connection point.
pdw
[out] A pointer to the cookie that uniquely identifies the connection.
A standard HRESULT value.
The sink implements the outgoing interface supported by the connection point. The client uses the pdw cookie to remove the connection by passing it to AtlUnadvise.
[!code-cppNVC_ATL_Windowing#91]
Terminates the connection established through AtlAdvise.
Important
This function cannot be used in applications that execute in the Windows Runtime.
HRESULT AtlUnadvise(
IUnknown* pUnkCP,
const IID& iid,
DWORD dw);
pUnkCP
[in] A pointer to the IUnknown
of the object that the client is connected with.
iid
[in] The GUID of the connection point. Typically, this is the same as the outgoing interface managed by the connection point.
dw
[in] The cookie that uniquely identifies the connection.
A standard HRESULT value.
[!code-cppNVC_ATL_Windowing#96]
Call this function to advise or unadvise all entries in the object's sink event map.
Important
This function cannot be used in applications that execute in the Windows Runtime.
HRESULT AtlAdviseSinkMap(T* pT, bool bAdvise);
pT
[in] A pointer to the object containing the sink map.
bAdvise
[in] TRUE if all sink entries are to be advised; FALSE if all sink entries are to be unadvised.
A standard HRESULT value.
[!code-cppNVC_ATL_Windowing#92]