X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/569f027b89890ed6f5ddbaf45bb1b53810e3519d..dc302518e6bf48326d202475bf78874fedcb2d9c:/src/msw/ole/dataobj.cpp?ds=sidebyside diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index fba8eb1427..48377785a4 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -761,9 +761,11 @@ const wxChar *wxDataObject::GetFormatName(wxDataFormat format) // wxBitmapDataObject supports CF_DIB format // ---------------------------------------------------------------------------- +// TODO: support CF_DIB under Windows CE as well + size_t wxBitmapDataObject::GetDataSize() const { -#if wxUSE_WXDIB +#if wxUSE_WXDIB && !defined(__WXWINCE__) return wxDIB::ConvertFromBitmap(NULL, GetHbitmapOf(GetBitmap())); #else return 0; @@ -772,7 +774,7 @@ size_t wxBitmapDataObject::GetDataSize() const bool wxBitmapDataObject::GetDataHere(void *buf) const { -#if wxUSE_WXDIB +#if wxUSE_WXDIB && !defined(__WXWINCE__) BITMAPINFO * const pbi = (BITMAPINFO *)buf; return wxDIB::ConvertFromBitmap(pbi, GetHbitmapOf(GetBitmap())) != 0; @@ -783,7 +785,7 @@ bool wxBitmapDataObject::GetDataHere(void *buf) const bool wxBitmapDataObject::SetData(size_t WXUNUSED(len), const void *buf) { -#if wxUSE_WXDIB +#if wxUSE_WXDIB && !defined(__WXWINCE__) const BITMAPINFO * const pbmi = (const BITMAPINFO *)buf; HBITMAP hbmp = wxDIB::ConvertToBitmap(pbmi); @@ -1035,13 +1037,13 @@ size_t wxFileDataObject::GetDataSize() const return 0; // inital size of DROPFILES struct + null byte - size_t sz = sizeof(DROPFILES) + 1; + size_t sz = sizeof(DROPFILES) + (1 * sizeof(wxChar)); size_t count = m_filenames.GetCount(); for ( size_t i = 0; i < count; i++ ) { // add filename length plus null byte - sz += m_filenames[i].Len() + 1; + sz += (m_filenames[i].Len() + 1) * sizeof(wxChar); } return sz; @@ -1080,7 +1082,7 @@ bool wxFileDataObject::GetDataHere(void *pData) const { // copy filename to pbuf and add null terminator size_t len = m_filenames[i].Len(); - memcpy(pbuf, m_filenames[i], len); + memcpy(pbuf, m_filenames[i], len*sizeof(wxChar)); pbuf += len; *pbuf++ = wxT('\0'); }