This documentation is archived and is not being maintained.

IDataObject.QueryGetData Method

Determines whether the data object is capable of rendering the data described in the FORMATETC structure. Objects attempting a paste or drop operation can call this method before calling GetData to get an indication of whether the operation may be successful.

Namespace:  System.Runtime.InteropServices.ComTypes
Assembly:  System (in System.dll)

int QueryGetData(
	ref FORMATETC format


Type: System.Runtime.InteropServices.ComTypes.FORMATETC%
A pointer to a FORMATETC structure, passed by reference, that defines the format, medium, and target device to use for the query.

Return Value

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




A subsequent call to GetData would probably be successful.


An invalid value for lindex; currently, only -1 is supported.


An invalid value for the pFormatetc parameter.


An invalid tymed value.


An invalid dwAspect value.


The application is not running.

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.