26 m_pDropSource(pDropSource),
41 if (pformatetcIn ==
NULL || pmedium ==
NULL)
44 pmedium->hGlobal =
NULL;
48 if (pformatetcIn->tymed & it->_format->tymed &&
49 pformatetcIn->dwAspect == it->_format->dwAspect &&
50 pformatetcIn->cfFormat == it->_format->cfFormat)
70 if (pformatetc ==
NULL)
74 if (!(DVASPECT_CONTENT & pformatetc->dwAspect))
81 if (pformatetc->tymed & it->_format->tymed)
83 if (pformatetc->cfFormat == it->_format->cfFormat)
99 if (pformatetcOut ==
NULL)
110 if (pformatetc ==
NULL || pmedium ==
NULL)
113 assert(pformatetc->tymed == pmedium->tymed);
114 FORMATETC* fetc=
new FORMATETC;
115 STGMEDIUM* pStgMed =
new STGMEDIUM;
117 if (fetc ==
NULL || pStgMed ==
NULL)
142 switch(pMedSrc->tymed)
151 pMedDest->hMetaFilePict = (HMETAFILEPICT)
OleDuplicateData(pMedSrc->hMetaFilePict, pFmtSrc->cfFormat, 0);
154 pMedDest->hEnhMetaFile = (HENHMETAFILE)
OleDuplicateData(pMedSrc->hEnhMetaFile, pFmtSrc->cfFormat, 0);
160 pMedDest->pstm = pMedSrc->pstm;
164 pMedDest->pstg = pMedSrc->pstg;
165 pMedSrc->pstg->AddRef();
171 pMedDest->tymed = pMedSrc->tymed;
172 pMedDest->pUnkForRelease = pMedSrc->pUnkForRelease;
179 if (ppenumFormatEtc ==
NULL)
182 *ppenumFormatEtc=
NULL;
188 if (!*ppenumFormatEtc)
191 (*ppenumFormatEtc)->AddRef();
274 if (pceltFetched !=
NULL)
277 ULONG cReturn = celt;
279 if (celt <= 0 || lpFormatEtc == NULL || m_iCur >=
m_pFmtEtc.
size())
282 if (pceltFetched ==
NULL && celt != 1)
290 if (pceltFetched !=
NULL)
291 *pceltFetched = celt - cReturn;
313 if (ppCloneEnumFormatEtc ==
NULL)
323 *ppCloneEnumFormatEtc = newEnum;
334 m_pDropTargetHelper(
NULL),
335 m_pSupportedFrmt(
NULL),
336 m_hTargetWnd(hTargetWnd)
384 DWORD dwOKEffects = *pdwEffect;
417 if (!(*pdwEffect & dwOKEffects))
430 if (pDataObj ==
NULL)
489 if (pDataObj ==
NULL)
#define STDMETHODCALLTYPE
virtual HRESULT STDMETHODCALLTYPE SetData(FORMATETC __RPC_FAR *pformatetc, STGMEDIUM __RPC_FAR *pmedium, BOOL fRelease)
virtual HRESULT STDMETHODCALLTYPE EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC __RPC_FAR *__RPC_FAR *ppenumFormatEtc)
virtual HRESULT STDMETHODCALLTYPE QueryGetData(FORMATETC __RPC_FAR *pformatetc)
virtual HRESULT STDMETHODCALLTYPE GetDataHere(FORMATETC __RPC_FAR *pformatetc, STGMEDIUM __RPC_FAR *pmedium)
virtual HRESULT STDMETHODCALLTYPE GetCanonicalFormatEtc(FORMATETC __RPC_FAR *pformatectIn, FORMATETC __RPC_FAR *pformatetcOut)
virtual HRESULT STDMETHODCALLTYPE GetData(FORMATETC __RPC_FAR *pformatetcIn, STGMEDIUM __RPC_FAR *pmedium)
IDataObjectImpl(IDropSourceImpl *pDropSource)
void CopyMedium(STGMEDIUM *pMedDest, STGMEDIUM *pMedSrc, FORMATETC *pFmtSrc)
virtual HRESULT STDMETHODCALLTYPE DAdvise(FORMATETC __RPC_FAR *pformatetc, DWORD advf, IAdviseSink __RPC_FAR *pAdvSink, DWORD __RPC_FAR *pdwConnection)
virtual HRESULT STDMETHODCALLTYPE EnumDAdvise(IEnumSTATDATA __RPC_FAR *__RPC_FAR *ppenumAdvise)
virtual ~IDataObjectImpl()
virtual HRESULT STDMETHODCALLTYPE DUnadvise(DWORD dwConnection)
implementation of IDropSource interface
virtual HRESULT STDMETHODCALLTYPE GiveFeedback(DWORD dwEffect)
virtual HRESULT STDMETHODCALLTYPE QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
virtual HRESULT STDMETHODCALLTYPE DragEnter(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
bool QueryDrop(DWORD grfKeyState, LPDWORD pdwEffect)
virtual HRESULT STDMETHODCALLTYPE Drop(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
IDropTargetHelper * m_pDropTargetHelper
virtual HRESULT STDMETHODCALLTYPE DragLeave()
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject)
virtual bool OnDrop(FORMATETC *pFmtEtc, STGMEDIUM &medium, DWORD *pdwEffect)=0
IDropTargetImpl(HWND m_hTargetWnd)
virtual ~IDropTargetImpl()
FORMATETC * m_pSupportedFrmt
virtual ULONG STDMETHODCALLTYPE Release()
virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
HRESULT Drop([in] IDataObject *pDataObject, [in] POINT *ppt, [in] DWORD dwEffect)
HRESULT DragOver([in] POINT *ppt, [in] DWORD dwEffect)
HRESULT DragEnter([in] HWND hwndTarget, [in] IDataObject *pDataObject, [in] POINT *ppt, [in] DWORD dwEffect)
const DWORD DROPEFFECT_NONE
const DWORD DROPEFFECT_LINK
const DWORD DROPEFFECT_COPY
const DWORD DROPEFFECT_MOVE
HANDLE WINAPI OleDuplicateData(HANDLE hSrc, CLIPFORMAT cfFormat, UINT uiFlags)
const GUID IID_IEnumFORMATETC
const GUID IID_IDataObject
structure containing information for one format of EnumFormatEtcImpl
void push_back(const _Tp &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
const value_type * const_iterator
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define DRAGDROP_S_USEDEFAULTCURSORS
#define DRAGDROP_S_CANCEL
#define OLE_E_ADVISENOTSUPPORTED
#define DATA_S_SAMEFORMATETC