IDataObject::SetData
Called by an
object containing a data source to transfer data to the object that implements
this method.
HRESULT SetData(
FORMATETC
* pFormatetc, |
//Pointer to the FORMATETC structure |
STGMEDIUM
* pmedium, |
//Pointer to STGMEDIUM structure |
BOOL fRelease |
//Indicates which object owns the storage medium
after the call is completed |
); |
|
Parameters
pFormatetc
[in] Pointer
to the FORMATETC structure defining the format used by the data object when
interpreting the data contained in the storage medium.
pmedium
[in] Pointer
to the STGMEDIUM structure defining the storage medium in which the data is
being passed.
fRelease
[in] If TRUE,
the data object called, which implements IDataObject::SetData, owns the
storage medium after the call returns. This means it must free the medium after
it has been used by calling the ReleaseStgMedium
Return Values
This method
supports the standard return values E_FAIL, E_INVALIDARG, E_UNEXPECTED, and
E_OUTOFMEMORY, as well as the following:
S_OK
Data was
successfully transferred.
E_NOTIMPL
This method
is not implemented for the data object.
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.
Remarks
IDataObject::SetData allows another object to attempt to send data to the
implementing data object. A data object implements this method if it supports
receiving data from another object. If it does not support this, it should be
implemented to return E_NOTIMPL.
The caller allocates
the storage medium indicated by the pmedium, in which the data is
passed. The data object called does not take ownership of the data until it has
successfully received it and no error code is returned. The value of the fRelease
parameter indicates the ownership of the medium after the call returns. FALSE
indicates the caller still owns the medium, and the data object only has the
use of it during the call; TRUE indicates that the data object now owns it and
must release it when it is no longer needed.
The type of
medium (TYMED
See Also