virtual BOOL OnSetData( LPFORMATETC pFormatEtc, LPSTGMEDIUM pStgMedium, BOOL bRelease );
Return Value
Nonzero if successful; otherwise 0.
Parameters
pFormatEtc
Pointer to a FORMATETC structure specifying the format of the data.
pStgMedium
Pointer to a STGMEDIUM structure in which the data resides.
bRelease
Indicates who has ownership of the storage medium after completing the function call. The caller decides who is responsible for releasing the resources allocated on behalf of the storage medium. The caller does this by setting bRelease. If bRelease is nonzero, the server item takes ownership, freeing the medium when it has finished using it. When bRelease is 0, the caller retains ownership and the server item can use the storage medium only for the duration of the call.
Remarks
Called by the framework to replace the OLE item’s data with the specified data. The server item does not take ownership of the data until it has successfully obtained it. That is, it does not take ownership if it returns 0. If the data source takes ownership, it frees the storage medium by calling the ReleaseStgMedium function.
The default implementation does nothing. Override this function to replace the OLE item’s data with the specified data. This is an advanced overridable.
For more information, see STGMEDIUM, FORMATETC, and ReleaseStgMedium in the OLE 2 Programmer’s Reference, Volume 1.
COleServerItem Overview | Class Members | Hierarchy Chart
See Also COleDataSource::OnSetData