Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / January 2004



Tip: Looking for answers? Try searching our database.

Getting MacOSX Version

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DLPnet - 26 Jan 2004 15:05 GMT
Hello,

How can I get the OS Version in C++ ? (I need to know if it s 10.1 or
10.2 or 10.3)

Thanks a lot,

Dlp
Frederick Cheung - 26 Jan 2004 16:02 GMT
> Hello,
>
> How can I get the OS Version in C++ ? (I need to know if it s 10.1 or
> 10.2 or 10.3)

use gestalt.

Fred
Kaydell - 26 Jan 2004 18:32 GMT
> Hello,
>
[quoted text clipped - 4 lines]
>
> Dlp

 long versionDetected;
 OSErr errCode;

        errCode = (Gestalt(gestaltSystemVersion,&versionDetected));

the OS version number is returned in "versionDetected" as a hex number for example:

0x0922, 0x1000, 0x1010, 0x1020, 0x1030
Miro Jurisic - 26 Jan 2004 22:37 GMT
>         errCode = (Gestalt(gestaltSystemVersion,&versionDetected));
>
> the OS version number is returned in "versionDetected" as a hex number for
> example:
>
> 0x0922, 0x1000, 0x1010, 0x1020, 0x1030

It's not hex, it's BCD.

hth

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

Mike Cohen - 27 Jan 2004 02:21 GMT
> >         errCode = (Gestalt(gestaltSystemVersion,&versionDetected));
> >
> > the OS version number is returned in "versionDetected" as a hex number for
> > example:
> >
> > 0x0922, 0x1000, 0x1010, 0x1020, 0x1030

How about the build number? I've never been able to figure that one out.

Signature

Mike Cohen - mike3k <at> onepost <dot> net
Personal: http://www.mc-development.com/
Mac News: http://www.macmegasite.com/

Miro Jurisic - 27 Jan 2004 06:17 GMT
> How about the build number? I've never been able to figure that one out.

Use CFPropertyList to load /System/Library/CoreServices/SystemVersion.plist.

hth

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.