// Created:
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// Licence: wxWindows license
+// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "droptgt.h"
#endif
#if wxUSE_OLE && wxUSE_DRAG_AND_DROP
+#include "wx/msw/private.h"
#include "wx/log.h"
+#ifdef __WXWINCE__
+ #include <winreg.h>
+ #include <ole2.h>
+#endif
+
#ifdef __WIN32__
#if !defined(__GNUWIN32__) || wxUSE_NORLANDER_HEADERS
#if wxCHECK_W32API_VERSION( 1, 0 )
- #include <windows.h>
+ #include "wx/msw/wrapwin.h"
#endif
#include <shlobj.h> // for DROPFILES structure
#endif
#include "wx/dnd.h"
-#ifndef __WIN32__
- #include <ole2.h>
- #include <olestd.h>
-#endif
-
#include "wx/msw/ole/oleutils.h"
// ----------------------------------------------------------------------------
// get default drop effect for given keyboard flags
static inline DWORD GetDropEffect(DWORD flags);
+
+ DECLARE_NO_COPY_CLASS(wxIDropTarget)
};
// ----------------------------------------------------------------------------
wxIDropTarget::wxIDropTarget(wxDropTarget *pTarget)
{
- m_cRef = 0;
m_pTarget = pTarget;
m_pIDataObject = NULL;
}
bool wxDropTarget::Register(WXHWND hwnd)
{
- HRESULT hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE);
+ HRESULT hr;
+
+ // May exist in later WinCE versions
+#ifndef __WXWINCE__
+ hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE);
if ( FAILED(hr) ) {
wxLogApiError(wxT("CoLockObjectExternal"), hr);
return FALSE;
}
+#endif
hr = ::RegisterDragDrop((HWND) hwnd, m_pIDropTarget);
if ( FAILED(hr) ) {
+ // May exist in later WinCE versions
+#ifndef __WXWINCE__
::CoLockObjectExternal(m_pIDropTarget, FALSE, FALSE);
-
+#endif
wxLogApiError(wxT("RegisterDragDrop"), hr);
return FALSE;
}
wxLogApiError(wxT("RevokeDragDrop"), hr);
}
+ // May exist in later WinCE versions
+#ifndef __WXWINCE__
::CoLockObjectExternal(m_pIDropTarget, FALSE, TRUE);
+#endif
m_pIDropTarget->SetHwnd(0);
}
case DROPEFFECT_COPY:
return wxDragCopy;
+ case DROPEFFECT_LINK:
+ return wxDragLink;
+
case DROPEFFECT_MOVE:
return wxDragMove;
case wxDragCopy:
return DROPEFFECT_COPY;
+ case wxDragLink:
+ return DROPEFFECT_LINK;
+
case wxDragMove:
return DROPEFFECT_MOVE;