Add Advise Connection

HRESULT CConnectionsArray::Add(
REFIID riid, 
IUnknown *pUnkNotifier, 
IUnknown pUnkNotify, 
BOOL fAddRefNotify = TRUE )

Parameters

riid

IID of the notification interface.

*pUnkNotifier

Pointer to IUknown of the notifier object.

*pUnkNotify

Pointer to IUknown of the object to be notified.

fAddRefNotify

TRUE to add a reference count to pUnkNotify during an active advise connection.

Return Code

See AdviseConnect.

Comments

Adds an advise connection. The object referenced by pUnkNotify must implement the notification interface identified by riid. fAddRefNotify should be set to FALSE when it is not desirable to increment pUnkNotify’s reference count. riid is unique in the array, in that only one entry will be created for multiple calls with the same riid. If an entry already exists, then the current advise connection is disconnected, if any; and a new advise connection is made between the given pUnkNotifier and pUnkNotify.