X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d026fee446b2085a1bbdaee2d7a1050a7cbd1467..02221dcb0a284f538bd65ad9229e2f37e4e4c291:/include/wx/msw/private.h diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index ce738893b1..462bf91ec7 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -605,14 +605,25 @@ private: class GlobalPtr { public: + // default ctor, call Init() later + GlobalPtr() + { + m_hGlobal = NULL; + } + // allocates a block of given size - GlobalPtr(size_t size, unsigned flags = GMEM_MOVEABLE) + void Init(size_t size, unsigned flags = GMEM_MOVEABLE) { m_hGlobal = ::GlobalAlloc(flags, size); if ( !m_hGlobal ) wxLogLastError(_T("GlobalAlloc")); } + GlobalPtr(size_t size, unsigned flags = GMEM_MOVEABLE) + { + Init(size, flags); + } + ~GlobalPtr() { if ( m_hGlobal && ::GlobalFree(m_hGlobal) ) @@ -930,7 +941,7 @@ extern WXDLLIMPEXP_CORE wxWindow* wxFindWinFromHandle(HWND hwnd); // without STRICT WXHWND is the same as HWND anyhow inline wxWindow* wxFindWinFromHandle(WXHWND hWnd) { - return wxFindWinFromHandle(wx_static_cast(HWND, hWnd)); + return wxFindWinFromHandle(static_cast(hWnd)); } // find the window for HWND which is part of some wxWindow, i.e. unlike