viksoe.dk

atldataobj.h


This article was submitted .


This ATL file contains various helper classes for both standard and OLE clipboard operations in Windows. The primary class implements a general IDataObject object, allowing you to store most common data types and clipboard formats inside it.

OLE clipboard objects (IDataObject) are used both when you copy custom clipboard items to the clipboard and during drag'n'drop operations in Windows.

For instance the following ATL code initiates a drag'n'drop operation with a text string:

CComObject<CSimpleDataObj>* pObj;
CComObject<CSimpleDataObj>::CreateInstance(&pObj);
pObj->SetTextData(sText);

DWORD dwEffect = 0;
::DoDragDrop(pObj, this, DROPEFFECT_COPY, &dwEffect);

Source Code Dependencies

Microsoft ATL Library

Download Files

DownloadSource Code (6 Kb)