Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Test OS 32 or 64 bit

204 views
Skip to first unread message

Roberto Origgi

unread,
Oct 7, 2009, 8:23:22 AM10/7/09
to
Hi,
How I can test if Operative System is 32 or 64 bit with PowerBuilder 10.5 ?

Thank in advance


Jerry Siegel [TeamSybase]

unread,
Oct 7, 2009, 11:36:25 AM10/7/09
to
IFAIK PB runs as a 32-bit application.
http://msdn.microsoft.com/en-us/library/aa384249%28VS.85%29.aspx


--
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...

Roland Smith [TeamSybase]

unread,
Oct 7, 2009, 12:21:08 PM10/7/09
to
This might help.

http://www.topwizprogramming.com/freecode_osversion.html

"Roberto Origgi" <roberto...@clsoft.it> wrote in message
news:4acc883a$1@forums-1-dub...

Shawn

unread,
Oct 8, 2009, 10:44:36 AM10/8/09
to
Roland,

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

Scott Morris

unread,
Oct 8, 2009, 1:06:32 PM10/8/09
to
"Roberto Origgi" <roberto...@clsoft.it> wrote in message
news:4acc883a$1@forums-1-dub...
> Hi,
> How I can test if Operative System is 32 or 64 bit with PowerBuilder 10.5
> ?

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


Roland Smith [TeamSybase]

unread,
Oct 9, 2009, 10:12:11 AM10/9/09
to
Shawn,

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


Shawn

unread,
Oct 11, 2009, 8:52:59 AM10/11/09
to
Roland,

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

Wheeley

unread,
Oct 17, 2009, 2:27:06 AM10/17/09
to
On 11 Oct 2009 05:52:59 -0700, Shawn wrote:

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

Wheeley

unread,
Oct 19, 2009, 12:22:36 AM10/19/09
to
On 16 Oct 2009 23:27:06 -0700, Wheeley <whe...@ix.netcom.com> wrote:

Foud this api call to test if a 64-bit os is running a 32-bit app.

IsWow64Process

Wheeley

Jerry Siegel [TeamSybase]

unread,
Oct 21, 2009, 12:41:33 PM10/21/09
to
http://tech.yahoo.com/blogs/null/153621/are-you-ready-for-128-bit-windows/
Planned release 2012. Isn't that when the Mayan calendar says the world will
end?


"Wheeley" <whe...@ix.netcom.com> wrote in message
news:faqnd5di2dksmpjtb...@4ax.com...

0 new messages