From c0dbf1fb9068440d186c566deea2593f98ca9727 Mon Sep 17 00:00:00 2001 From: David Webster Date: Wed, 15 Mar 2000 23:27:47 +0000 Subject: [PATCH] no message git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/os2/menu.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index a08ced90aa..d9cfa8d761 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -249,7 +249,7 @@ bool wxMenu::DoInsertOrAppend( m_vMenuData.iPosition = 0; // submenus have a 0 position m_vMenuData.id = (USHORT)pSubmenu->GetHMenu(); - m_vMenuData.afStyle |= MIS_SUBMENU; + m_vMenuData.afStyle |= MIS_SUBMENU | MIS_TEXT; } else { @@ -657,7 +657,18 @@ WXHMENU wxMenuBar::Create() hMenuBar = GetHwnd(); for (size_t i = 0; i < nCount; i++) { - ::WinSendMsg(hMenuBar, MM_INSERTITEM, (MPARAM)&m_menus[i]->m_vMenuData, (MPARAM)m_titles[i].c_str()); + APIRET rc; + ERRORID vError; + wxString sError; + + rc = (APIRET)::WinSendMsg(hMenuBar, MM_INSERTITEM, (MPARAM)&m_menus[i]->m_vMenuData, (MPARAM)m_titles[i].c_str()); + if (rc == MIT_MEMERROR || rc == MIT_ERROR) + { + vError = ::WinGetLastError(vHabmain); + sError = wxPMErrorToStr(vError); + wxLogError("Error inserting or appending a menuitem. Error: %s\n", sError); + return NULLHANDLE; + } } } return hMenuBar; -- 2.45.2