Compartir a través de


COleDataSource::OnRenderData

Called by the framework to retrieve data in the specified format.

virtual BOOL OnRenderData(
   LPFORMATETC lpFormatEtc,
   LPSTGMEDIUM lpStgMedium 
);

Parameters

  • lpFormatEtc
    Points to the FORMATETC structure specifying the format in which information is requested.

  • lpStgMedium
    Points to a STGMEDIUM structure in which the data is to be returned.

Return Value

Nonzero if successful; otherwise 0.

Remarks

The specified format is one previously placed in the COleDataSource object using the DelayRenderData or DelayRenderFileData member function for delayed rendering. The default implementation of this function will call OnRenderFileData or OnRenderGlobalData if the supplied storage medium is either a file or memory, respectively. If neither of these formats are supplied, then the default implementation will return 0 and do nothing. For more information on delayed rendering as handled by MFC, see the article Data Objects and Data Sources: Manipulation.

If lpStgMedium->tymed is TYMED_NULL, the STGMEDIUM should be allocated and filled as specified by lpFormatEtc->tymed. If it is not TYMED_NULL, the STGMEDIUM should be filled in place with the data.

This is an advanced overridable. Override this function to supply your data in the requested format and medium. Depending on your data, you may want to override one of the other versions of this function instead. If your data is small and fixed in size, override OnRenderGlobalData. If your data is in a file, or is of variable size, override OnRenderFileData.

For more information, see the STGMEDIUM and FORMATETC structures, the TYMED enumeration type, and IDataObject::GetData in the Windows SDK*.*

Requirements

Header: afxole.h

See Also

Reference

COleDataSource Class

Hierarchy Chart

COleDataSource::DelayRenderData

COleDataSource::DelayRenderFileData

COleDataSource::OnRenderFileData

COleDataSource::OnRenderGlobalData

COleDataSource::OnSetData

Other Resources

COleDataSource Members