#include "wx/setup.h"
-#if wxUSE_DRAG_AND_DROP
+#if wxUSE_OLE && wxUSE_DRAG_AND_DROP
#include "wx/log.h"
#ifdef __WIN32__
- #ifndef __GNUWIN32__
+ #if !defined(__GNUWIN32__) || wxUSE_NORLANDER_HEADERS
+ #if wxCHECK_W32API_VERSION( 1, 0 )
+ #include <windows.h>
+ #endif
#include <shlobj.h> // for DROPFILES structure
#endif
#else
{
public:
wxIDropTarget(wxDropTarget *p);
- ~wxIDropTarget();
+ virtual ~wxIDropTarget();
// accessors for wxDropTarget
void SetHwnd(HWND hwnd) { m_hwnd = hwnd; }
// we need client coordinates to pass to wxWin functions
if ( !ScreenToClient(m_hwnd, (POINT *)&pt) )
{
- wxLogLastError("ScreenToClient");
+ wxLogLastError(wxT("ScreenToClient"));
}
// give some visual feedback
// we need client coordinates to pass to wxWin functions
if ( !ScreenToClient(m_hwnd, (POINT *)&pt) )
{
- wxLogLastError("ScreenToClient");
+ wxLogLastError(wxT("ScreenToClient"));
}
*pdwEffect = ConvertDragResultToEffect(
// 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
// 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);
{
HRESULT hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE);
if ( FAILED(hr) ) {
- wxLogApiError("CoLockObjectExternal", hr);
+ wxLogApiError(wxT("CoLockObjectExternal"), hr);
return FALSE;
}
if ( FAILED(hr) ) {
::CoLockObjectExternal(m_pIDropTarget, FALSE, FALSE);
- wxLogApiError("RegisterDragDrop", hr);
+ wxLogApiError(wxT("RegisterDragDrop"), hr);
return FALSE;
}
HRESULT hr = ::RevokeDragDrop((HWND) hwnd);
if ( FAILED(hr) ) {
- wxLogApiError("RevokeDragDrop", hr);
+ wxLogApiError(wxT("RevokeDragDrop"), hr);
}
::CoLockObjectExternal(m_pIDropTarget, FALSE, TRUE);
rc = TRUE;
}
else {
- wxLogLastError("IDataObject::SetData()");
+ wxLogLastError(wxT("IDataObject::SetData()"));
}
}
else {
- wxLogLastError("IDataObject::GetData()");
+ wxLogLastError(wxT("IDataObject::GetData()"));
}
return rc;
// 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);