IDataObject.SetData(IntPtr, IntPtr, Int32) IDataObject.SetData(IntPtr, IntPtr, Int32) IDataObject.SetData(IntPtr, IntPtr, Int32) IDataObject.SetData(IntPtr, IntPtr, Int32) Method

Definition

Transfers the data that is contained in the STGMEDIUM structure, referenced by a, to this instance of the IDataObject interface.

public:
 int SetData(IntPtr a, IntPtr b, int c);
public int SetData (IntPtr a, IntPtr b, int c);
abstract member SetData : nativeint * nativeint * int -> int
Public Function SetData (a As IntPtr, b As IntPtr, c As Integer) As Integer

Parameters

a
IntPtr IntPtr IntPtr IntPtr

A pointer to the FORMATETC defining the format for the data object implementing the IDataObject to use when interpreting the data contained in the storage medium.

b
IntPtr IntPtr IntPtr IntPtr

A pointer to the STGMEDIUM defining the storage medium for the SetData method to use to pass the data.

c
Int32 Int32 Int32 Int32

true to specify that the called data object implementing the IDataObject owns the storage medium after the call and must free the medium after it has been used; otherwise, false to specify the caller retains ownership of the storage medium and the data object uses the medium for the duration of the call only.

Returns

The SetData method supports the standard return values E_FAIL, E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following return values:

Return value Description
S_OK This call to the SetData method successfully transferred the data.
E_NOTIMPL The SetData method is not implemented for the data object implementing the IDataObject.
DV_E_LINDEX lindex is not valid.
DV_E_FORMATETC pFormatEtc is not valid.
DV_E_TYMED tymed is not valid.
DV_E_DVASPECT dwAspect is not valid.
OLE_E_NOTRUNNING The object application is not running.

Remarks

For more information about programming with the IDataObject interface and the Microsoft Management Console (MMC), see the MMC Programmer's Guide.

Applies to