STDMETHODIMP CDropTarget::DragLeave() { HRESULT hr = S_OK; if(m_pDropTarget) { // next call should release the shell item's grip on the transferred data object hr = m_pDropTarget->DragLeave(); // and we are done with the drop target interface, too m_pDropTarget->Release(); m_pDropTarget = NULL; } Release(); return hr; }
//----------------------------------------------------------------------------- // exit point when something is actually dropped STDMETHODIMP CDropTarget::Drop(LPDATAOBJECT pDataObject, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) { HRESULT hr = S_OK; if(m_pDropTarget) { // this call will actually perform the file operation in pdwEffect hr = m_pDropTarget->Drop(pDataObject, grfKeyState, pt, pdwEffect); // all is said & done // perform cleanup similar to DragLeave() above m_pDropTarget->Release(); m_pDropTarget = NULL; } Release(); return hr; }