Share via


ClipboardObject.IDataObject.SetData Method

Transfers data to the object that implements this method. This method is called by an object that contains a data source.

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

Syntax

'Declaration
Private Sub SetData ( _
    pFormatetc As FORMATETC(), _
    pmedium As STGMEDIUM(), _
    fRelease As Integer _
) Implements IDataObject.SetData
void IDataObject.SetData(
    FORMATETC[] pFormatetc,
    STGMEDIUM[] pmedium,
    int fRelease
)
private:
virtual void SetData(
    array<FORMATETC>^ pFormatetc, 
    array<STGMEDIUM>^ pmedium, 
    int fRelease
) sealed = IDataObject::SetData
private abstract SetData : 
        pFormatetc:FORMATETC[] * 
        pmedium:STGMEDIUM[] * 
        fRelease:int -> unit  
private override SetData : 
        pFormatetc:FORMATETC[] * 
        pmedium:STGMEDIUM[] * 
        fRelease:int -> unit
JScript does not support explicit interface implementations.

Parameters

  • fRelease
    Type: System.Int32

    true to specify that the data object called, which implements SetData, owns the storage medium after the call returns. This means that the data object must free the medium after it has been used by calling the ReleaseStgMedium function. false to specify that the caller retains ownership of the storage medium, and that the data object called uses the storage medium for the duration of the call only.

Implements

IDataObject.SetData(array<FORMATETC[], array<STGMEDIUM[], Int32)

Exceptions

Exception Condition
ArgumentNullException

The clipboard object is not a wrapped Microsoft.VisualStudio.OLE.Interop.IDataObject and the pFormatetc and/or pmedium parameters are null.

ArgumentException

The clipboard object is not a wrapped Microsoft.VisualStudio.OLE.Interop.IDataObject and the length of the pFormatetc and/or pmedium structure is zero.

Remarks

If the clipboard object wraps an existing IDataObject (from the Microsoft.VisualStudio.OLE.Interop namespace), this method delegates the call to the corresponding SetData from that namespace. Otherwise, it attempts to translate the call to the corresponding IDataObject.SetData from the System.Runtime.InteropServices.ComTypes namespace, in case the clipboard object could be wrapping an existing IDataObject.

.NET Framework Security

See Also

Reference

ClipboardObject Class

Microsoft.VisualStudio.Data.Framework Namespace