X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/146dcf3e22216705d3b3caf140b4f76521e63a52..47892637d342b05c1e932ee6f71283f1217c2491:/src/msw/dib.cpp diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 5d2ef8e621..ee17d5d2b1 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -30,15 +30,16 @@ #pragma hdrstop #endif +#if wxUSE_WXDIB + #ifndef WX_PRECOMP #include "wx/string.h" #include "wx/log.h" + #include "wx/intl.h" + #include "wx/bitmap.h" + #include "wx/image.h" #endif //WX_PRECOMP -#if wxUSE_WXDIB - -#include "wx/bitmap.h" -#include "wx/intl.h" #include "wx/file.h" #include @@ -48,7 +49,6 @@ #include #endif -#include "wx/image.h" #include "wx/msw/dib.h" #ifdef __WXWINCE__ @@ -566,7 +566,7 @@ HGLOBAL wxDIB::ConvertFromBitmap(HBITMAP hbmp) return NULL; } - if ( !ConvertFromBitmap((BITMAPINFO *)(void *)GlobalPtr(hDIB), hbmp) ) + if ( !ConvertFromBitmap((BITMAPINFO *)(void *)GlobalPtrLock(hDIB), hbmp) ) { // this really shouldn't happen... it worked the first time, why not // now? @@ -588,6 +588,10 @@ HGLOBAL wxDIB::ConvertFromBitmap(HBITMAP hbmp) wxPalette *wxDIB::CreatePalette() const { + // GetDIBColorTable not available in eVC3 +#if defined(_WIN32_WCE) && _WIN32_WCE < 400 + return NULL; +#else wxCHECK_MSG( m_handle, NULL, _T("wxDIB::CreatePalette(): invalid object") ); DIBSECTION ds; @@ -630,7 +634,7 @@ wxPalette *wxDIB::CreatePalette() const // and the colour table wxCharBuffer rgb(sizeof(RGBQUAD) * biClrUsed); RGBQUAD *pRGB = (RGBQUAD*)rgb.data(); - SelectInHDC(hDC, m_handle); + SelectInHDC selectHandle(hDC, m_handle); ::GetDIBColorTable(hDC, 0, biClrUsed, pRGB); for ( DWORD i = 0; i < biClrUsed; i++, pRGB++ ) { @@ -655,6 +659,7 @@ wxPalette *wxDIB::CreatePalette() const palette->SetHPALETTE((WXHPALETTE)hPalette); return palette; +#endif } #endif // wxUSE_PALETTE @@ -795,4 +800,3 @@ wxImage wxDIB::ConvertToImage() const #endif // wxUSE_IMAGE #endif // wxUSE_WXDIB -