X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61243a510fe15e04996a986daaa53ed9fee75484..d6c85bee754c3a69723fd10ea88cd9bcab83e87b:/src/os2/window.cpp diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 01e0e83c30..5120d55fa2 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -84,6 +84,10 @@ #define GET_Y_LPARAM(mp) ((unsigned short)(unsigned long)(mp >> 16)) #endif // GET_X_LPARAM +#ifndef CW_USEDEFAULT +# define CW_USEDEFAULT ((int)0x80000000) +#endif + // --------------------------------------------------------------------------- // global variables // --------------------------------------------------------------------------- @@ -2323,6 +2327,8 @@ bool wxWindow::OS2Create( , WXDWORD dwExtendedStyle // Port compatability only ) { + ERRORID vError; + wxString sError; int nX1 = CW_USEDEFAULT; int nY1 = 0; int nWidth1 = CW_USEDEFAULT; @@ -2346,6 +2352,8 @@ bool wxWindow::OS2Create( nWidth1 = vParentRect.xRight - vParentRect.xLeft; nHeight1 = vParentRect.yTop - vParentRect.yBottom; } + else + hParent = HWND_DESKTOP; if (nX > -1) nX1 = nX; @@ -2369,7 +2377,7 @@ bool wxWindow::OS2Create( PDLGTEMPLATE pDlgt; ::DosGetResource(0L, RT_DIALOG, vId, (PPVOID)&pDlgt); - m_hWnd = (WXHWND)::WinCreateDlg( pParent->GetHWND() + m_hWnd = (WXHWND)::WinCreateDlg( hParent ,NULLHANDLE ,(PFNWP)wxDlgProc ,pDlgt @@ -2377,8 +2385,11 @@ bool wxWindow::OS2Create( ); if (m_hWnd == 0) { - wxLogError(_("Can't find dummy dialog template!\n" - "Check resource include path for finding wx.rc.")); + vError = ::WinGetLastError(vHabmain); + sError = wxPMErrorToStr(vError); + wxLogError("Can't find dummy dialog template!\n" + "Check resource include path for finding wx.rc.\n" + "Error: %s\n", sError); return FALSE; } @@ -2394,7 +2405,9 @@ bool wxWindow::OS2Create( ,SWP_MOVE | SWP_SIZE | SWP_NOREDRAW )); { - wxLogLastError(wxT("MoveWindow")); + vError = ::WinGetLastError(vHabmain); + sError = wxPMErrorToStr(vError); + wxLogError("MoveWindow, error: %s\n", sError); } } else @@ -2443,7 +2456,9 @@ bool wxWindow::OS2Create( ); if (!m_hWnd) { - wxLogError("Can't create window of class %s!\n", zWclass); + vError = ::WinGetLastError(vHabmain); + sError = wxPMErrorToStr(vError); + wxLogError("Can't create window of class %s!. Error: %s\n", zWclass, sError); return FALSE; } }