Share via


ClipboardObject.IDataObject.DAdvise Method

Definition

Creates a connection between the clipboard 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.

 virtual int System.Runtime.InteropServices.ComTypes.IDataObject.DAdvise(System::Runtime::InteropServices::ComTypes::FORMATETC % pFormatetc, System::Runtime::InteropServices::ComTypes::ADVF advf, System::Runtime::InteropServices::ComTypes::IAdviseSink ^ adviseSink, [Runtime::InteropServices::Out] int % connection) = System::Runtime::InteropServices::ComTypes::IDataObject::DAdvise;
int IDataObject.DAdvise (ref System.Runtime.InteropServices.ComTypes.FORMATETC pFormatetc, System.Runtime.InteropServices.ComTypes.ADVF advf, System.Runtime.InteropServices.ComTypes.IAdviseSink adviseSink, out int connection);
override this.System.Runtime.InteropServices.ComTypes.IDataObject.DAdvise : FORMATETC * System.Runtime.InteropServices.ComTypes.ADVF * System.Runtime.InteropServices.ComTypes.IAdviseSink * int -> int
Function DAdvise (ByRef pFormatetc As FORMATETC, advf As ADVF, adviseSink As IAdviseSink, ByRef connection As Integer) As Integer Implements IDataObject.DAdvise

Parameters

pFormatetc
FORMATETC

A FORMATETC structure, passed by reference, that defines the format, target device, aspect, and medium that will be used for future notifications.

advf
ADVF

A value from the ADVF enumeration that specifies a group of flags for controlling the advisory connection.

adviseSink
IAdviseSink

An IAdviseSink object pointing to the advisory sink that will receive the change notification.

connection
Int32

Out parameter. When this method returns, this parameter contains a token that identifies this connection. You can use this token later to delete the advisory connection by passing it to IDataObject.DUnadvise(Int32). If this value is zero, the connection was not established. This parameter is passed uninitialized.

Returns

This method supports the standard return values E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following: ValueDescriptionS_OKThe advisory connection was created.E_NOTIMPLThis method is not implemented on the data object.DV_E_LINDEXThere is an invalid value for lindex; currently only -1 is supported.DV_E_FORMATETCThere is an invalid value for the pFormatetc parameter.OLE_E_ADVISENOTSUPPORTEDThe data object does not support change notification.

Implements

Applies to