LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

detect 32 / 64 bit OS

Dear CVI users,

I've got a simple question:

I know that with the "GetWinOSVersion" si possibile to detect on which Win OS the application is running [GetWinOSVersion (&MajorVer, &MinorVer, &Build, &Platform);].

I was wondering if is there a way to detect if the OS is 32 or 64 bit.

thanks in advance.

0 Kudos
Message 1 of 6
(4,317 Views)

you could try to determine the size of an integer, it should make a difference...

0 Kudos
Message 2 of 6
(4,314 Views)

I'll make a try... but I'm afraid that the size of an integer is decided at compiler time, not at runtime...

What do you think?

0 Kudos
Message 3 of 6
(4,305 Views)

yep, you're right... if you have the full CVI version, you could use e.g. the GetNativeSystemInfo function, see here

0 Kudos
Message 4 of 6
(4,296 Views)

See:

 

http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx

 

The code there should get you started on how to determine exactly what OS version you are running on.

 

Caveats: It uses Windows SDK functions and I have not personally tested it in CVI. Also, the comments below the code indicate that it has some problems. But like I said, it is a start.

Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 5 of 6
(4,242 Views)

There's a slightly easier method with example code here.

--
Martin
Certified CVI Developer
0 Kudos
Message 6 of 6
(4,227 Views)