More WinCE mods

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-07-11 23:10:35 +00:00
parent f07dc2e2a7
commit 4cb88a72da
2 changed files with 24 additions and 2 deletions

View File

@@ -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
}
// ----------------------------------------------------------------------------

View File

@@ -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);
}