Thank in advance
--
Report Bugs to Sybase: http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement
"Roberto Origgi" <roberto...@clsoft.it> wrote in message
news:4acc883a$1@forums-1-dub...
http://www.topwizprogramming.com/freecode_osversion.html
"Roberto Origgi" <roberto...@clsoft.it> wrote in message
news:4acc883a$1@forums-1-dub...
When I run your application on Vista 64bit I get no OS name
or edition. As I stepped through your code, it works all
the way to line 92 of function of_getosversion of
n_osversion where it's checking the lstr_ovi.dwMinorVersion.
When I run, lstr_ovi.dw_MinorVersion is 0 so it goes into
the first case statement where it next applies a case
statement to check the value of lstr_ovi.wProductType. When
I run, the value of the variable is 7681 but it's trying to
match it to two values in the case statement
(VER_NT_WORKSTATION which has a value of 1 and VER_NT_SERVER
which has a value of 3) neither of which equal 7681.
Consequently it falls through without assigning an OSVersion
or OSEdition.
Can you help clarify?
Shawn
Try:
http://msdn.microsoft.com/en-us/library/ms724340(VS.85).aspx
But this says "To determine whether a Win32-based application is running
under WOW64, call the IsWow64Process function."
http://msdn.microsoft.com/en-us/library/ms684139(VS.85).aspx
What version of PB are you using?
The structure OSVERSIONINFOEX has this definition:
OSVERSIONINFOEX {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
TCHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
}
The BYTE datatype in PowerBuilder wasn't introduced until 10.5. So for my
example I used unsignedinteger instead. I do not have access to a Vista
machine so as you have found, not all combinations work. If you have 10.5 or
later, change the structure so that wproducttype is Byte and then add a Byte
member called wreserved. Then in the Instance Variables change ProductType
to Byte.
If you are still getting a value other than 1 or 3, just add that value to
the case statement so that it takes the Vista path.
Here is a link to where I got the background info to code the example:
http://www.codeguru.com/cpp/misc/misc/system/print.php/c8973
Thanks for the info. To answer your question, I'm running
Powerbuilder 11.5 on a Vista 64 machine (cutting edge, huh?
lol). I'll try out your suggestions and get this working
with the proper check values.
Thanks again for the contribution.
Regards,
Shawn
Look here for a PB version;
http://www.topwizprogramming.com/
Though both of these examples only get the OS type not necessairly if
it is a 32 or 64 bit version.
Wheeley
Foud this api call to test if a 64-bit os is running a 32-bit app.
IsWow64Process
Wheeley
--
Report Bugs to Sybase: http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement
"Wheeley" <whe...@ix.netcom.com> wrote in message
news:faqnd5di2dksmpjtb...@4ax.com...