IDataObject::GetData
Called by a
data consumer to obtain data from a source data object. The GetData
method renders the data described in the specified FORMATETC
HRESULT GetData(
FORMATETC
* pFormatetc, |
//Pointer to the FORMATETC structure |
STGMEDIUM
* pmedium |
//Pointer to the STGMEDIUM structure |
); |
|
Parameters
pFormatetc
[in] Pointer
to the FORMATETC structure that defines the format, medium, and target device
to use when passing the data. It is possible to specify more than one medium by
using the Boolean OR operator, allowing the method to choose the best medium
among those specified.
pmedium
[out] Pointer
to the STGMEDIUM
Return Values
This method
supports the standard return values E_INVALIDARG, E_UNEXPECTED, and
E_OUTOFMEMORY, as well as the following:
S_OK
Data was
successfully retrieved and placed in the storage medium provided.
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
Object
application is not running.
STG_E_MEDIUMFULL
An error
occurred when allocating the medium.
Remarks
A data
consumer calls IDataObject::GetData to retrieve data from a data object,
conveyed through a storage medium (defined through the STGMEDIUM structure).
Notes to Callers
You can
specify more than one acceptable TYMED
Data
transferred across a stream extends from position zero of the stream pointer
through to the position immediately before the current stream pointer (that is,
the stream pointer position upon exit).
Notes to Implementers
IDataObject::GetData must check all fields in the FORMATETC
Although the
caller can specify more than one medium for returning the data, IDataObject::GetData
can supply only one medium. If the initial transfer fails with the selected
medium, this method can be implemented to try one of the other media specified
before returning an error.
See Also