From 6d3fcdd5f248cc6e705ea8dca96c1169b511fda3 Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sun, 6 Jun 2004 16:30:44 +0000 Subject: [PATCH] Initialize m_PageSize. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@27667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/os2/dcclient.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/os2/dcclient.cpp b/src/os2/dcclient.cpp index 9d33ade289..f45831fdaf 100644 --- a/src/os2/dcclient.cpp +++ b/src/os2/dcclient.cpp @@ -86,6 +86,7 @@ static RECT g_paintStruct; wxWindowDC::wxWindowDC() { m_pCanvas = NULL; + m_PageSize.cx = m_PageSize.cy = 0; } wxWindowDC::wxWindowDC( @@ -94,8 +95,12 @@ wxWindowDC::wxWindowDC( { ERRORID vError; wxString sError; + int nWidth, nHeight; m_pCanvas = pTheCanvas; + DoGetSize(&nWidth, &nHeight); + m_PageSize.cx = nWidth; + m_PageSize.cy = nHeight; m_hDC = (WXHDC) ::WinOpenWindowDC(GetWinHwnd(pTheCanvas) ); // @@ -109,6 +114,12 @@ wxWindowDC::wxWindowDC( ,&m_PageSize ,PU_PELS | GPIF_LONG | GPIA_ASSOC ); + if (!m_hPS) + { + vError = ::WinGetLastError(vHabmain); + sError = wxPMErrorToStr(vError); + wxLogError("Unable to create presentation space. Error: %s\n", sError.c_str()); + } ::GpiAssociate(m_hPS, NULLHANDLE); ::GpiAssociate(m_hPS, m_hDC);