From: Vadim Zeitlin Date: Thu, 28 Feb 2008 02:52:26 +0000 (+0000) Subject: correct WinCE compilation after last change: can't use global scope with GlobalLock... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/82d1a19568ce7c468067a11f09aafaf3a770c9f8 correct WinCE compilation after last change: can't use global scope with GlobalLock/Unlock() there git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 5a1d2f3fe2..4bed1f04b8 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -597,7 +597,7 @@ private: HDCMapModeChanger wxMAKE_UNIQUE_NAME(wxHDCMapModeChanger)(hdc, mm) #endif // __WXWINCE__/!__WXWINCE__ -// smart buffeer using GlobalAlloc/GlobalFree() +// smart pointer using GlobalAlloc/GlobalFree() class GlobalPtr { public: @@ -643,7 +643,10 @@ public: void Init(HGLOBAL hGlobal) { m_hGlobal = hGlobal; - m_ptr = ::GlobalLock(hGlobal); + + // NB: GlobalLock() is a macro, not a function, hence don't use the + // global scope operator with it (and neither with GlobalUnlock()) + m_ptr = GlobalLock(hGlobal); if ( !m_ptr ) wxLogLastError(_T("GlobalLock")); } @@ -656,7 +659,7 @@ public: ~GlobalPtrLock() { - if ( m_hGlobal && !::GlobalUnlock(m_hGlobal) ) + if ( m_hGlobal && !GlobalUnlock(m_hGlobal) ) { #ifdef __WXDEBUG__ // this might happen simply because the block became unlocked