Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

COleDataSource Class

Acts as a cache into which an application places the data that it will offer during data transfer operations, such as Clipboard or drag-and-drop operations.

class COleDataSource : public CCmdTarget

You can create OLE data sources directly. Alternately, the COleClientItem and COleServerItem classes create OLE data sources in response to their CopyToClipboard and DoDragDrop member functions. See COleServerItem::CopyToClipboard for a brief description. Override the OnGetClipboardData member function of your client item or server item class to add additional Clipboard formats to the data in the OLE data source created for the CopyToClipboard or DoDragDrop member function.

Whenever you want to prepare data for a transfer, you should create an object of this class and fill it with your data using the most appropriate method for your data. The way it is inserted into a data source is directly affected by whether the data is supplied immediately (immediate rendering) or on demand (delayed rendering). For every Clipboard format in which you are providing data by passing the Clipboard format to be used (and an optional FORMATETC structure), call DelayRenderData.

For more information about data sources and data transfer, see the article Data Objects and Data Sources (OLE). In addition, the article Clipboard Topics describes the OLE Clipboard mechanism.

Header: afxole.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.