Called by a data consumer to obtain data from a source data object. The GetData method renders the data described in the specified FORMATETC structure and transfers it through the specified STGMEDIUM structure. The caller then assumes responsibility for releasing the STGMEDIUM structure.
HRESULT GetData(
FORMATETC * pFormatetc, //Pointer to the FORMATETC structure
STGMEDIUM * pmedium //Pointer to the STGMEDIUM structure
);
This method supports the standard return values E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following:
A data consumer calls IDataObject::GetData to retrieve data from a data object, conveyed through a storage medium (defined through the STGMEDIUM structure).
You can specify more than one acceptable TYMED medium with the Boolean OR operator. IDataObject::GetData must choose from the OR'd values the medium that best represents the data, do the allocation, and indicate responsibility for releasing the medium.
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).
IDataObject::GetData must check all fields in the FORMATETC structure. It is important that IDataObject::GetData render the requested aspect and, if possible, use the requested medium. If the data object cannot comply with the information specified in the FORMATETC, the method should return DV_E_FORMATETC. If an attempt to allocate the medium fails, the method should return STG_E_MEDIUMFULL. It is important to fill in all of the fields in the STGMEDIUM structure.
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.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in objidl.h.
IDataObject::GetDataHere, IDataObject::SetData, FORMATETC, STGMEDIUM