Share via


IDataObject::QueryGetData (Compact 2013)

3/26/2014

This 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 the IDataObject::GetData method to get an indication of whether the operation may be successful.

Syntax

HRESULT QueryGetData(
  FORMATETC* pFormatetc
);

Parameters

  • pFormatetc
    [in] Pointer to the FORMATETC structure defining the format, medium, and target device to use for the query.

Return Value

This method supports the standard return values E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY.

The following table shows the additional return values for this method.

Value

Description

S_OK

Subsequent call to IDataObject::GetData would probably be successful.

DV_E_LINDEX

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

DV_E_FORMATETC

Invalid value for pFormatetc.

DV_E_TYMED

Invalid TYMED value.

DV_E_DVASPECT

Invalid dwAspect value.

OLE_E_NOTRUNNING

The object application is not running.

Remarks

The client of a data object calls IDataObject::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.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header

objidl.h,
objidl.idl

Library

ole32.lib,
uuid.lib

See Also

Reference

IDataObject
IDataObject::GetData
FORMATETC