1 out of 1 rated this helpful - Rate this topic

IDataObject::QueryGetData method

Applies to: desktop apps only

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

pformatetc [in]

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 codeDescription
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

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

ObjIdl.h

IDL

ObjIdl.idl

IID

IID_IDataObject is defined as 0000010e-0000-0000-C000-000000000046

See also

IDataObject

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
S_FALSE is also a possible return value
If you request an unsupported format (cfFormat), the Windows 7 Explorer implementation of this method will return S_FALSE, and therefore SUCCEEDED(hr) should not be used to test for an accepted format.