X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/82df67d960355e99a66b1db473b9d6236bf2fbb9..e4a8a172020d5e3ee08660420142e702799c7878:/src/msw/ole/droptgt.cpp diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index c24d9d4008..46da03329d 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -6,7 +6,7 @@ // Created: // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "droptgt.h" #endif @@ -32,12 +32,18 @@ #if wxUSE_OLE && wxUSE_DRAG_AND_DROP +#include "wx/msw/private.h" #include "wx/log.h" +#ifdef __WXWINCE__ + #include + #include +#endif + #ifdef __WIN32__ #if !defined(__GNUWIN32__) || wxUSE_NORLANDER_HEADERS #if wxCHECK_W32API_VERSION( 1, 0 ) - #include + #include "wx/msw/wrapwin.h" #endif #include // for DROPFILES structure #endif @@ -47,11 +53,6 @@ #include "wx/dnd.h" -#ifndef __WIN32__ - #include - #include -#endif - #include "wx/msw/ole/oleutils.h" // ---------------------------------------------------------------------------- @@ -85,6 +86,8 @@ protected: // get default drop effect for given keyboard flags static inline DWORD GetDropEffect(DWORD flags); + + DECLARE_NO_COPY_CLASS(wxIDropTarget) }; // ---------------------------------------------------------------------------- @@ -327,16 +330,23 @@ wxDropTarget::~wxDropTarget() 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; } @@ -355,7 +365,10 @@ void wxDropTarget::Revoke(WXHWND hwnd) wxLogApiError(wxT("RevokeDragDrop"), hr); } + // May exist in later WinCE versions +#ifndef __WXWINCE__ ::CoLockObjectExternal(m_pIDropTarget, FALSE, TRUE); +#endif m_pIDropTarget->SetHwnd(0); }