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
This commit is contained in:
Vadim Zeitlin
2003-04-13 21:58:59 +00:00
parent 70ddb200c1
commit 06d0938900
3 changed files with 6 additions and 7 deletions

View File

@@ -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__

View File

@@ -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?

View File

@@ -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);