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
Members
Public Constructors
Name |
Description |
---|---|
Constructs a COleDataSource object. |
Public Methods
Name |
Description |
---|---|
Offers data in a specified format using a STGMEDIUM structure. |
|
Offers data in a specified format using an HGLOBAL. |
|
Offers data in a specified format using delayed rendering. |
|
Offers data in a specified format in a CFile pointer. |
|
Called for every format that is supported in OnSetData. |
|
Performs drag-and-drop operations with a data source. |
|
Empties the COleDataSource object of data. |
|
Renders all data to the Clipboard. |
|
Verifies that the data placed on the Clipboard is still there. |
|
Retrieves data as part of delayed rendering. |
|
Retrieves data into a CFile as part of delayed rendering. |
|
Retrieves data into an HGLOBAL as part of delayed rendering. |
|
Called to replace the data in the COleDataSource object. |
|
Places a COleDataSource object on the Clipboard. |
Remarks
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.
Inheritance Hierarchy
COleDataSource
Requirements
Header: afxole.h