DataObject.IDataObject.QueryGetData Method (FORMATETC)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

This API supports the product infrastructure and is not intended to be used directly from your code.

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.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
int IDataObject.QueryGetData(
	ref FORMATETC formatetc
)

Parameters

formatetc
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:

Value

Description

S_OK

A subsequent call to GetData would probably be successful.

DV_E_LINDEX

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

DV_E_FORMATETC

An invalid value for the pFormatetc parameter.

DV_E_TYMED

An invalid tymed value.

DV_E_DVASPECT

An invalid dwAspect value.

OLE_E_NOTRUNNING

The application is not running.

This member is an explicit interface member implementation. It can be used only when the DataObject is cast to an IDataObject interface.

SecurityPermission

for calling unmanaged code. Associated enumeration: SecurityPermissionFlag.UnmanagedCode

.NET Framework
Available since 2.0
Return to top
Show: