本文整理汇总了C++中COleDataSource::Empty方法的典型用法代码示例。如果您正苦于以下问题:C++ COleDataSource::Empty方法的具体用法?C++ COleDataSource::Empty怎么用?C++ COleDataSource::Empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COleDataSource
的用法示例。
在下文中一共展示了COleDataSource::Empty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnItemClick
HRESULT __stdcall CXMiLFilesControl::OnItemClick(DWORD item)
{
#if 0
HGLOBAL hData = BuildSelectedFilesClipboard();
if (hData)
{
CMyDropSource* dropSource = new CMyDropSource;
CMyDataObject* dataObject = new CMyDataObject;
STGMEDIUM stg = {0};
stg.tymed = TYMED_HGLOBAL;
stg.hGlobal = hData;
stg.pUnkForRelease = NULL;
FORMATETC etc = {0};
etc.cfFormat = CF_HDROP;//CF_UNICODETEXT;//49285;//RegisterClipboardFormat(CFSTR_SHELLURL);//CF_TEXT;
etc.tymed = TYMED_HGLOBAL;
etc.ptd = NULL;
etc.dwAspect = DVASPECT_CONTENT;
etc.lindex = -1;
dataObject->SetData(&etc, &stg, TRUE);
DWORD dropEffect = 0;
HRESULT hr = ::DoDragDrop(dataObject, dropSource, DROPEFFECT_LINK | DROPEFFECT_COPY | DROPEFFECT_MOVE, &dropEffect);
if (hr == DRAGDROP_S_DROP)
{
if (dropEffect/* & DROPEFFECT_MOVE*/)
{
}
}
GlobalFree(hData);
// delete dataObject;
// delete dropSource;
#if 0
COleDataSource source;
source.CacheGlobalData(CF_HDROP, hData, NULL);
if (source.DoDragDrop(DROPEFFECT_COPY | DROPEFFECT_MOVE, NULL, NULL) == DROPEFFECT_COPY)
{
}
source.Empty();
#endif
GlobalFree(hData);
}
#endif
return S_OK;
}