]> git.saurik.com Git - wxWidgets.git/commitdiff
correct WinCE compilation after last change: can't use global scope with GlobalLock...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 28 Feb 2008 02:52:26 +0000 (02:52 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 28 Feb 2008 02:52:26 +0000 (02:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/private.h

index 5a1d2f3fe203e7ad46dfa7c80adf4544c7d2292a..4bed1f04b88e43d6cbf03126a16e47de99bc3523 100644 (file)
@@ -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