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 LibraryDownload Files
![]() | Source Code (6 Kb) |