News: SPECIAL OFFER: EZGUI Classic (4.0) until May 31, 2013 only $29 !

Check out our online Video Tutorials ! http://www.youtube.com/user/ComputerWorkshopSoft

TO REGISTER on Forum, contact tech support: http://cwsof.com/support.html
 
Pages: [1]   Go Down
  Print  
Author Topic: EZ_GetOS Returns Incorrect Value  (Read 592 times)
Frank Kelley
Newbie
*
Posts: 48


View Profile WWW
« on: July 29, 2012, 08:02:12 PM »

Under EZGUI 5.0, calling EZ_GetOS(0) returns a value of 501 on my Win7/64 machine. The docs claim this value should be 601.

ADDED: Actually, this is NOT a problem with EZGUI. Windows GETVERSIONEX also returns 5.01 on my version of Win7. Anyone else notice this behavior?
« Last Edit: July 29, 2012, 08:20:10 PM by Frank Kelley » Logged
Dan Gin zel
EZGUI SLL Beta
Sr. Member
*
Posts: 265


View Profile WWW
« Reply #1 on: July 29, 2012, 09:50:23 PM »

My 64-bit Windows 7 system returns 601.

Do you have some compatibility features enabled ?
Logged

http://www.thecomputerarchive.com Preserving the history of companies that advanced the computer revolution
Chris Boss
Administrator
Hero Member
*****
Posts: 1812


View Profile
« Reply #2 on: July 30, 2012, 08:20:12 AM »

The docs are correct.

Windows 7 should generate a version of 601.

Was the computer originally Windows XP and the upgraded to Windows 7 ?

The version number generated by EZGUI is based on a call to GetVersionEx. The major version number returned is multipled by 100 (ie. 6 x 100 = 600) and then the minor version value is added to it (ie. 600 + 1 = 601).

Here is some code from MSDN :

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724429(v=vs.85).aspx

and it shows Windows 7 as 601.

Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1812


View Profile
« Reply #3 on: July 30, 2012, 08:23:11 AM »

Here is another web page from MSDN and if you scroll down you will see a list of the values for major/minor version numbers for each OS:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724833(v=vs.85).aspx

Remeber, EZGUI multiples the major version number by 100 and then adds the minor version number.
Logged
Frank Kelley
Newbie
*
Posts: 48


View Profile WWW
« Reply #4 on: July 30, 2012, 10:57:12 AM »

This is a completely new machine with a fresh install of Win7/64 from scratch. No compatibility features have been enabled. Both EZ_GetOS(0) and GetVersionEx return 501/5.01 respectively.
Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1812


View Profile
« Reply #5 on: July 30, 2012, 11:14:07 AM »

That is very strange !

The API docs say Windows 7 should be 6.01 (or 601 with EZ_GetOS).

You might want to do a Google search for GetVersionEx to see if anyone else has experienced a worng value.

Could be some kind of windows bug, don't know.
Logged
Chris Boss
Administrator
Hero Member
*****
Posts: 1812


View Profile
« Reply #6 on: July 30, 2012, 11:22:59 AM »

Make sure your application uses a manifest !

If Windows 7 runs an app which has no manifest, it may assume it requires XP compatibility mode and GetVersionEx may return a value for XP, rather than Windows 7.

The EZGUI 5.0 designer has theme support built in, so it can generate a proper manifest for the resources.

Logged
Frank Kelley
Newbie
*
Posts: 48


View Profile WWW
« Reply #7 on: July 30, 2012, 11:40:20 AM »

The application in question is using a manifest. And my Win7 has been updated to SP1. I am compiling under PB10 and using EZGUI 5.0. This is definitely not an EZGUI problem, because GetVersionEx is also reporting the same information. I have a second Win7 machine (laptop) and I need to test there to determine if this is just a problem with my new development machine or not.
Logged
Frank Kelley
Newbie
*
Posts: 48


View Profile WWW
« Reply #8 on: July 30, 2012, 12:04:23 PM »

Problem solved.

My development suite includes JellyFish Pro and Lynx.  I had Lynx set to XP compatibility mode and that is apparently the determining factor for the version number.  If I compile and run the program within Lynx/JellyFish I get a version of 5.01.  If I double-click the compiled .exe to run the app standalone, I get 6.01.

The solution was to remove the compatibility setting for Lynx. This gives me 6.01 consistently. I recall setting the compatibility for Lynx to XP because I had some problems getting Lynx to run initially on the Win7 machine and tried that as the solution.

Thanks.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: