]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dib.cpp
fix bug in Borland (bcc32 really hates ?)
[wxWidgets.git] / src / msw / dib.cpp
index fe4136e2a3b35ec72532d961751e3a0608636011..5cd30f4f41b5d4bda70eebef4d17c2ad576f9240 100644 (file)
@@ -299,11 +299,11 @@ HBITMAP wxDIB::ConvertToBitmap(const BITMAPINFO *pbmi, HDC hdc, void *bits)
 
         bits = (char *)pbmih + sizeof(*pbmih) + numColors*sizeof(RGBQUAD);
     }
-
+    HDC tmphdc = hdc;
+    if (!hdc) tmphdc = ScreenHDC();
     HBITMAP hbmp = ::CreateDIBitmap
                      (
-                        hdc ? hdc           // create bitmap compatible
-                            : ScreenHDC(),  //  with this DC
+                        tmphdc,             // create bitmap compatible with this DC
                         pbmih,              // used to get size &c
                         CBM_INIT,           // initialize bitmap bits too
                         bits,               // ... using this data