]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msw/private.h
fix for digitalmars header
[wxWidgets.git] / include / wx / msw / private.h
index 3bd6f49620225f84f06cdfbde55f9d547dc85df9..7f26ece1cb627dd44eb12289be577c3574cb19c1 100644 (file)
@@ -362,13 +362,13 @@ private:
     DECLARE_NO_COPY_CLASS(ScreenHDC)
 };
 
-// the same as ScreenHDC but for memory DCs: creates the HDC in ctor and
-// destroys it in dtor
+// the same as ScreenHDC but for memory DCs: creates the HDC compatible with
+// the given one (screen by default) in ctor and destroys it in dtor
 class MemoryHDC
 {
 public:
-    MemoryHDC() { m_hdc = ::CreateCompatibleDC(NULL); }
-   ~MemoryHDC() { ::DeleteDC(m_hdc);                  }
+    MemoryHDC(HDC hdc = 0) { m_hdc = ::CreateCompatibleDC(hdc); }
+   ~MemoryHDC() { ::DeleteDC(m_hdc); }
 
     operator HDC() const { return m_hdc; }
 
@@ -401,10 +401,10 @@ private:
 // 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 )
@@ -413,7 +413,7 @@ public:
         }
     }
 
-    ~GlobalHandle()
+    ~GlobalPtr()
     {
         if ( !::GlobalUnlock(m_hGlobal) )
         {
@@ -434,7 +434,7 @@ private:
     HGLOBAL m_hGlobal;
     void *m_ptr;
 
-    DECLARE_NO_COPY_CLASS(GlobalHandle)
+    DECLARE_NO_COPY_CLASS(GlobalPtr)
 };
 
 // ---------------------------------------------------------------------------