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: System.Runtime.InteropServices.ComTypes
Assembly: System (in system.dll)

void SetData (
	[InAttribute] ref FORMATETC formatIn,
	[InAttribute] ref STGMEDIUM medium,
	bool release
void SetData (
	/** @attribute InAttribute() */ /** @ref */ FORMATETC formatIn, 
	/** @attribute InAttribute() */ /** @ref */ STGMEDIUM medium, 
	boolean release
Not applicable.



A FORMATETC structure, passed by reference, that defines the format used by the data object when interpreting the data contained in the storage medium.


A STGMEDIUM structure, passed by reference, that defines the storage medium in which the data is being passed.


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 the data object called uses the storage medium for the duration of the call only.

For more information about IDataObject::SetData, see the MSDN Library.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0