From: Vadim Zeitlin Date: Sun, 13 Apr 2003 21:58:59 +0000 (+0000) Subject: renamed GlobalHandle class to GlobalPtr to avoid conflict with the Win32 function X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/06d0938900acc655a047c9a81b97ffda838c4b17 renamed GlobalHandle class to GlobalPtr to avoid conflict with the Win32 function git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index f21b7a5d5b..b37696a247 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -399,15 +399,14 @@ private: }; #ifdef __WATCOM__ -//FIXME why does watcom dislike this ?? CE 05 April 2003 // when working with global pointers (which is unfortunately still necessary // sometimes, e.g. for clipboard) it is important to unlock them exactly as // many times as we lock them which just asks for using a "smart lock" class -class GlobalHandle +class GlobalPtr { public: - GlobalHandle(HGLOBAL hGlobal) : m_hGlobal(hGlobal) + GlobalPtr(HGLOBAL hGlobal) : m_hGlobal(hGlobal) { m_ptr = ::GlobalLock(hGlobal); if ( !m_ptr ) @@ -416,7 +415,7 @@ public: } } - ~GlobalHandle() + ~GlobalPtr() { if ( !::GlobalUnlock(m_hGlobal) ) { @@ -437,7 +436,7 @@ private: HGLOBAL m_hGlobal; void *m_ptr; - DECLARE_NO_COPY_CLASS(GlobalHandle) + DECLARE_NO_COPY_CLASS(GlobalPtr) }; #endif //__WATCOM__ diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index ef71fc3f51..e630937f07 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -440,7 +440,7 @@ HGLOBAL wxDIB::ConvertFromBitmap(HBITMAP hbmp) return NULL; } - if ( !ConvertFromBitmap((BITMAPINFO *)GlobalHandle(hDIB), hbmp) ) + if ( !ConvertFromBitmap((BITMAPINFO *)GlobalPtr(hDIB), hbmp) ) { // this really shouldn't happen... it worked the first time, why not // now? diff --git a/src/msw/tbarmsw.cpp b/src/msw/tbarmsw.cpp index 2db4053acf..d166b81736 100644 --- a/src/msw/tbarmsw.cpp +++ b/src/msw/tbarmsw.cpp @@ -1103,7 +1103,7 @@ WXHBITMAP wxToolBar::CreateMappedBitmap(WXHINSTANCE hInstance, WXHBITMAP hBitmap if ( !hDIB ) return 0; - WXHBITMAP newBitmap = CreateMappedBitmap(hInstance, GlobalHandle(hDIB)); + WXHBITMAP newBitmap = CreateMappedBitmap(hInstance, GlobalPtr(hDIB)); GlobalFree(hDIB);