From 4cb88a72da82ab3488b6643f34755daf7c930043 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 11 Jul 2003 23:10:35 +0000 Subject: [PATCH 1/1] More WinCE mods git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/ole/dataobj.cpp | 12 ++++++++++++ src/msw/ole/droptgt.cpp | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index b7dee87332..83a2761aa0 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -762,18 +762,27 @@ const wxChar *wxDataObject::GetFormatName(wxDataFormat format) size_t wxBitmapDataObject::GetDataSize() const { +#if wxUSE_WXDIB return wxDIB::ConvertFromBitmap(NULL, GetHbitmapOf(GetBitmap())); +#else + return 0; +#endif } bool wxBitmapDataObject::GetDataHere(void *buf) const { +#if wxUSE_WXDIB BITMAPINFO * const pbi = (BITMAPINFO *)buf; return wxDIB::ConvertFromBitmap(pbi, GetHbitmapOf(GetBitmap())) != 0; +#else + return FALSE; +#endif } bool wxBitmapDataObject::SetData(size_t WXUNUSED(len), const void *buf) { +#if wxUSE_WXDIB const BITMAPINFO * const pbmi = (const BITMAPINFO *)buf; HBITMAP hbmp = wxDIB::ConvertToBitmap(pbmi); @@ -789,6 +798,9 @@ bool wxBitmapDataObject::SetData(size_t WXUNUSED(len), const void *buf) SetBitmap(bitmap); return TRUE; +#else + return FALSE; +#endif } // ---------------------------------------------------------------------------- diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index 8d8f6fbf1c..37818b5760 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -330,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; } @@ -358,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); } -- 2.45.2