diff --git a/source/3_image.cpp b/source/3_image.cpp index ad2e043..9af778c 100644 --- a/source/3_image.cpp +++ b/source/3_image.cpp @@ -19,7 +19,7 @@ #include "ui_win.hpp" -#include +//#include // -------------------------------------------------------------------------- // ----- UIW_IMAGE ---------------------------------------------------------- @@ -203,7 +203,7 @@ int UIW_IMAGE::LoadImageFromFile(void) // Load the bitmap. ZIL_UINT32 dibSize = bitmapFileHeader.bfSize - sizeof(BITMAPFILEHEADER); ZIL_UINT32 tdibSize = dibSize; - ZIL_UINT8 *dib = (ZIL_UINT8 *)GlobalAllocPtr(GMEM_MOVEABLE, dibSize); + ZIL_UINT8 *dib = (ZIL_UINT8 *)GlobalLock(GlobalAlloc(GMEM_MOVEABLE, dibSize)); ZIL_UINT8 *tdib = dib; for ( ; dibSize; dibSize -= tdibSize, tdib += tdibSize) { @@ -222,7 +222,9 @@ int UIW_IMAGE::LoadImageFromFile(void) ReleaseDC(NULL, hDC); // Clean up. - GlobalFreePtr(dib); + GlobalUnlock( (HGLOBAL)GlobalHandle( dib ) ); + GlobalFree( (HGLOBAL)GlobalHandle( dib ) ); + delete bitmapInfo; woStatus &= ~WOS_READ_ERROR; return (image ? TRUE : FALSE); diff --git a/source/9_image.cpp b/source/9_image.cpp index f360e30..732a7cf 100644 --- a/source/9_image.cpp +++ b/source/9_image.cpp @@ -19,7 +19,7 @@ #include "ui_win.hpp" -#include +//#include // -------------------------------------------------------------------------- // ----- UIW_IMAGE ---------------------------------------------------------- @@ -202,7 +202,7 @@ int UIW_IMAGE::LoadImageFromFile(void) // Load the bitmap. ZIL_UINT32 dibSize = bitmapFileHeader.bfSize - sizeof(BITMAPFILEHEADER); ZIL_UINT32 tdibSize = dibSize; - ZIL_UINT8 *dib = (ZIL_UINT8 *)GlobalAllocPtr(GMEM_MOVEABLE, dibSize); + ZIL_UINT8 *dib = (ZIL_UINT8 *)GlobalLock(GlobalAlloc(GMEM_MOVEABLE, dibSize)); ZIL_UINT8 *tdib = dib; for ( ; dibSize; dibSize -= tdibSize, tdib += tdibSize) { @@ -221,7 +221,9 @@ int UIW_IMAGE::LoadImageFromFile(void) ReleaseDC(NULL, hDC); // Clean up. - GlobalFreePtr(dib); + GlobalUnlock( (HGLOBAL)GlobalHandle( dib ) ); + GlobalFree( (HGLOBAL)GlobalHandle( dib ) ); + delete bitmapInfo; woStatus &= ~WOS_READ_ERROR; return (image ? TRUE : FALSE); diff --git a/source/w_image.cpp b/source/w_image.cpp index a94909d..145f1c4 100644 --- a/source/w_image.cpp +++ b/source/w_image.cpp @@ -3,12 +3,6 @@ // Zinc Software Incorporated. Pleasant Grove, Utah USA #include "ui_win.hpp" -#include - -#if defined(__WATCOMC__) - #undef GlobalFreePtr - #define GlobalFreePtr(lp) (GlobalUnlockPtr(lp), (BOOL)GlobalFree(GlobalPtrHandle(lp))) -#endif // -------------------------------------------------------------------------- // ----- UIW_IMAGE ---------------------------------------------------------- @@ -195,7 +189,7 @@ int UIW_IMAGE::LoadImageFromFile(void) // Load the bitmap. ZIL_UINT32 dibSize = bitmapFileHeader.bfSize - sizeof(BITMAPFILEHEADER); ZIL_UINT32 tdibSize = dibSize; - ZIL_UINT8 huge *dib = (ZIL_UINT8 huge *)GlobalAllocPtr(GMEM_MOVEABLE, dibSize); + ZIL_UINT8 huge *dib = (ZIL_UINT8 huge *)GlobalLock(GlobalAlloc(GMEM_MOVEABLE, dibSize)); ZIL_UINT8 huge *tdib = dib; for ( ; dibSize; dibSize -= tdibSize, tdib += tdibSize) {