DataObject.IDataObject.DAdvise Method (FORMATETC, ADVF, IAdviseSink, Int32)
This API supports the product infrastructure and is not intended to be used directly from your code.
Creates a connection between a data object and an advisory sink. This method is called by an object that supports an advisory sink and enables the advisory sink to be notified of changes in the object's data.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] int IDataObject.DAdvise( ref FORMATETC pFormatetc, ADVF advf, IAdviseSink pAdvSink, out int pdwConnection )
A FORMATETC structure, passed by reference, that defines the format, target device, aspect, and medium that will be used for future notifications.
One of the ADVF values that specifies a group of flags for controlling the advisory connection.
A pointer to the IAdviseSink interface on the advisory sink that will receive the change notification.
When this method returns, contains a pointer to a DWORD token that identifies this connection. You can use this token later to delete the advisory connection by passing it to DUnadvise. If this value is zero, the connection was not established. This parameter is passed uninitialized.
Return ValueType: System.Int32
This method supports the standard return values E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following:
The advisory connection was created.
This method is not implemented on the data object.
There is an invalid value for lindex; currently, only -1 is supported.
There is an invalid value for the pFormatetc parameter.
The data object does not support change notification.
Available since 2.0