wxGetOsVersion() is giving different result in different applications on the same machine  [SOLVED]

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
sakthivel
In need of some credit
In need of some credit
Posts: 3
Joined: Thu May 10, 2018 7:54 am

wxGetOsVersion() is giving different result in different applications on the same machine

Postby sakthivel » Thu May 10, 2018 10:06 am

Hi.

I created two UI applications using wxWidget3.0.4. Both the applications have Frame and menus. In one application i am getting assert message while clicking on menu(..\src\msw\toplevel.cpp assert"m_menuDepth>0"), other application working fine.

While searching for this issue i found that wxGetOsVersion() returning "wxWinVersion_Unknown", that is why assert is coming. In other application wxGetOsVersion() is returning wxWinVersion_7.

I tried ::GetVersionEx() method in both the applications. In working project it giving MajorVersion - 6 & MinorVersion - 1(Windows7), In non working project MajorVersion - 8 & MinorVersion - 3.


I am not sure why it is giving wrong value, Both projects using wxWidget3.0.4 & VS2015. I checked the project configuration, it looks same for bot the projects.

Pls help me to find why it is returning different value in the same machine. Actually i am migrating these projects from wxWidget2.4.2 to wxWidget3.0.4.
I am sure, both the projects link with wxWidget3.0.4\lib\vc_dll\, i added all the necessary libs.

- wxWidget3.0.4
- VS2015
- Windows7 64bit
- ProjectConfiuration Debug - 32bit


Thanks.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1756
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxGetOsVersion() is giving different result in different applications on the same machine

Postby PB » Thu May 10, 2018 11:03 am

Is it really 8.3 and not 6.3 in the non-working project? Does GetVersionEx() still return TRUE?

I know it is a stupid question but: Are you sure it is Windows 7 and not 8 or newer? If it was W8+, this could be affected by application compatibility settings.

If it is really Windows 7 there must be something really wrong IMO...

sakthivel
In need of some credit
In need of some credit
Posts: 3
Joined: Thu May 10, 2018 7:54 am

Re: wxGetOsVersion() is giving different result in different applications on the same machine

Postby sakthivel » Thu May 10, 2018 11:12 am

Yes it is 8.3 in the no-working project and GetVersionEx() returning TRUE #-o .

Are you sure it is Windows 7 and not 8 or newer? - Yes Windows7

In working project it is 6.1 .

User avatar
doublemax
Moderator
Moderator
Posts: 12822
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxGetOsVersion() is giving different result in different applications on the same machine  [SOLVED]

Postby doublemax » Thu May 10, 2018 11:19 am

I can't think of any reason why this could happen. Googling i found one post with a similar issue and Microsofts AppVerifier was the reason. Do you have that installed?

https://stackoverflow.com/questions/238 ... jorversion
Use the source, Luke!

sakthivel
In need of some credit
In need of some credit
Posts: 3
Joined: Thu May 10, 2018 7:54 am

Re: wxGetOsVersion() is giving different result in different applications on the same machine

Postby sakthivel » Thu May 10, 2018 11:56 am

doublemax wrote:I can't think of any reason why this could happen. Googling i found one post with a similar issue and Microsofts AppVerifier was the reason. Do you have that installed?
https://stackoverflow.com/questions/238 ... jorversion


@doublemax =D> =D> AppVerifier is the culprit. Thank you so much man.


Return to “Platform Related Issues”

Who is online

Users browsing this forum: No registered users and 5 guests