X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50c375d311ac4cefbf1ae1d11e19c9e7c00a873e..889f0b7c67f207f230d8bf9f558ae35445d57e10:/src/msw/ole/droptgt.cpp diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index 67825f8569..99db777028 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -35,7 +35,7 @@ #include "wx/log.h" #ifdef __WIN32__ - #ifndef __GNUWIN32__ + #if !defined(__GNUWIN32__) || wxUSE_NORLANDER_HEADERS #include // for DROPFILES structure #endif #else @@ -61,7 +61,7 @@ class wxIDropTarget : public IDropTarget { public: wxIDropTarget(wxDropTarget *p); - ~wxIDropTarget(); + virtual ~wxIDropTarget(); // accessors for wxDropTarget void SetHwnd(HWND hwnd) { m_hwnd = hwnd; } @@ -157,7 +157,7 @@ STDMETHODIMP wxIDropTarget::DragEnter(IDataObject *pIDataSource, // we need client coordinates to pass to wxWin functions if ( !ScreenToClient(m_hwnd, (POINT *)&pt) ) { - wxLogLastError("ScreenToClient"); + wxLogLastError(wxT("ScreenToClient")); } // give some visual feedback @@ -197,7 +197,7 @@ STDMETHODIMP wxIDropTarget::DragOver(DWORD grfKeyState, // we need client coordinates to pass to wxWin functions if ( !ScreenToClient(m_hwnd, (POINT *)&pt) ) { - wxLogLastError("ScreenToClient"); + wxLogLastError(wxT("ScreenToClient")); } *pdwEffect = ConvertDragResultToEffect( @@ -250,7 +250,7 @@ STDMETHODIMP wxIDropTarget::Drop(IDataObject *pIDataSource, // we need client coordinates to pass to wxWin functions if ( !ScreenToClient(m_hwnd, (POINT *)&pt) ) { - wxLogLastError("ScreenToClient"); + wxLogLastError(wxT("ScreenToClient")); } // first ask the drop target if it wants data @@ -260,14 +260,11 @@ STDMETHODIMP wxIDropTarget::Drop(IDataObject *pIDataSource, // and now it has the data wxDragResult rc = ConvertDragEffectToResult(GetDropEffect(grfKeyState)); - m_pTarget->OnData(pt.x, pt.y);//, rc); -/* + rc = m_pTarget->OnData(pt.x, pt.y, rc); if ( wxIsDragResultOk(rc) ) { // operation succeeded *pdwEffect = ConvertDragResultToEffect(rc); } -*/ - //else: *pdwEffect is already DROPEFFECT_NONE } //else: OnDrop() returned FALSE, no need to copy data @@ -380,11 +377,11 @@ bool wxDropTarget::GetData() rc = TRUE; } else { - wxLogLastError("IDataObject::SetData()"); + wxLogLastError(wxT("IDataObject::SetData()")); } } else { - wxLogLastError("IDataObject::GetData()"); + wxLogLastError(wxT("IDataObject::GetData()")); } return rc; @@ -424,7 +421,8 @@ wxDataFormat wxDropTarget::GetSupportedFormat(IDataObject *pIDataSource) const // get the list of supported formats size_t nFormats = m_dataObject->GetFormatCount(wxDataObject::Set); - wxDataFormat format, *formats; + wxDataFormat format; + wxDataFormat *formats; formats = nFormats == 1 ? &format : new wxDataFormat[nFormats]; m_dataObject->GetAllFormats(formats, wxDataObject::Set);