allocate size for the extra controls in the file dialog (#9679)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-21 15:32:02 +00:00
parent 14fd5e968b
commit 6fa6d65956
5 changed files with 82 additions and 4 deletions

View File

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