Under certain conditions, selecting a menu item triggers an assert in toplevel.cpp:1544:

wxASSERT_MSG( m_menuDepth > 0, wxS("No open menus?") );

The conditions to reproduce:
- Windows 8.1
- An application manifest that indicates Windows 8.1 compatibility

In this case, wxGetWinVersion() used to return wxWinVersion_Unknown (Without a manifest indicating 8.1 support, wxWinVersion_8 is being returned). This in turn causes the version check against Windows98 in toplevel.cpp:455 to fail, ultimately leading to the mentioned assert.

See http://msdn.microsoft.com/en-us/library/windows/desktop/ms724439%28v=vs.85%29.aspx for details.


This patch on the 3.x branch of wx adjusts wxGetWinVersion to return wxWinVersion_8 on 8.1 instead of wxWinVersion_Unknown if there's such a manifest.

In future, a different approach needs to be chosen that does not depend the deprecated GetVersion function.




git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Tim Kosse
2014-06-15 22:18:12 +00:00
parent c519991540
commit 4461fbfb64

View File

@@ -1488,6 +1488,13 @@ wxWinVersion wxGetWinVersion()
case 2:
return wxWinVersion_8;
case 3:
// For now, map to wxWinVersion_8. In case program
// does not have a manifest indicating 8.1
// support, Windows already performs this mapping
// for us.
return wxWinVersion_8;
}
break;
}