IDataObject::QueryGetData method (objidl.h)

Determines whether the data object is capable of rendering the data as specified. Objects attempting a paste or drop operation can call this method before calling IDataObject::GetData to get an indication of whether the operation may be successful.

Syntax

HRESULT QueryGetData(
  [in] FORMATETC *pformatetc
);

Parameters

[in] pformatetc

A pointer to the FORMATETC structure defining the format, medium, and target device to use for the query.

Return value

This method returns S_OK on success. Other possible values include the following

Return code Description
DV_E_LINDEX
Invalid value for lindex; currently, only -1 is supported.
DV_E_FORMATETC
Invalid value for pformatetc.
DV_E_TYMED
The tymed value is not valid.
DV_E_DVASPECT
The dwAspect value is not valid.
OLE_E_NOTRUNNING
The object application is not running.
E_UNEXPECTED
An unexpected error has occurred.
E_INVALIDARG
The dwDirection value is not valid.
E_OUTOFMEMORY
There is insufficient memory available for this operation.

Remarks

The client of a data object calls QueryGetData to determine whether passing the specified FORMATETC structure to a subsequent call to IDataObject::GetData is likely to be successful. A successful return from this method does not necessarily ensure the success of the subsequent paste or drop operation.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header objidl.h

See also

IDataObject