Partager via


ClipboardObject.IDataObject.DAdvise Method

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.

Namespace:  Microsoft.VisualStudio.Data.Framework
Assembly:  Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)

Syntax

'Declaration
Private Function DAdvise ( _
    ByRef pFormatetc As FORMATETC, _
    advf As ADVF, _
    adviseSink As IAdviseSink, _
    <OutAttribute> ByRef connection As Integer _
) As Integer Implements IDataObject.DAdvise
int IDataObject.DAdvise(
    ref FORMATETC pFormatetc,
    ADVF advf,
    IAdviseSink adviseSink,
    out int connection
)
private:
virtual int DAdvise(
    FORMATETC% pFormatetc, 
    ADVF advf, 
    IAdviseSink^ adviseSink, 
    [OutAttribute] int% connection
) sealed = IDataObject::DAdvise
private abstract DAdvise : 
        pFormatetc:FORMATETC byref * 
        advf:ADVF * 
        adviseSink:IAdviseSink * 
        connection:int byref -> int  
private override DAdvise : 
        pFormatetc:FORMATETC byref * 
        advf:ADVF * 
        adviseSink:IAdviseSink * 
        connection:int byref -> int
JScript does not support explicit interface implementations.

Parameters

  • connection
    Type: System.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. If this value is zero, the connection was not established. This parameter is passed uninitialized.

Return Value

Type: System.Int32
This method supports the standard return values E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following:

Value

Description

S_OK

The advisory connection was created.

E_NOTIMPL

This method is not implemented on the data object.

DV_E_LINDEX

There is an invalid value for lindex; currently only -1 is supported.

DV_E_FORMATETC

There is an invalid value for the pFormatetc parameter.

OLE_E_ADVISENOTSUPPORTED

The data object does not support change notification.

Implements

IDataObject.DAdvise(FORMATETC%, ADVF, IAdviseSink, Int32%)

Remarks

This method delegates the call to the corresponding DAdvise from the System.Runtime.InteropServices.ComTypes namespace, assuming that the clipboard object is wrapping an existing IDataObject.

.NET Framework Security

See Also

Reference

ClipboardObject Class

Microsoft.VisualStudio.Data.Framework Namespace