Establishes a connection between the connection point object and the client's sink.
HRESULT Advise(
IUnknown *pUnk, //Pointer to the client's advise sink
DWORD *pdwCookie //Pointer to the connection point identifier used
// by Unadvise
);
This method supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:
Advise establishes a connection between the connection point and the caller's sink identified with pUnk.
The connection point must call pUnk->QueryInterface(iid, ...)
to obtain the correct outgoing interface pointer to call when events occur, where iid is the IID for the outgoing interface managed by the connection point. When iid is passed to the IConnectionPointContainer::FindConnectionPoint method, an interface pointer to this same connection point is returned.
The connection point must query the pUnk pointer for the correct outgoing interface. If this query fails, this method must return CONNECT_E_CANNOTCONNECT.
The pdwCookie value must be unique for each connection to any given instance of a connection point.
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in ocidl.h.