Solved

NT/98/95 OS detection

Posted on 2000-04-26
3
185 Views
Last Modified: 2010-04-02
I have a program written in BCB and I have to detect the OS it's running on, it's because it accesses the parrallel port which has other routines in 9x than in NT, before accessing the ParPort I have to make choise between NT and 9x OS, can anyone help me?
0
Comment
Question by:rdno
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 2751329
Simply use this code snippet:

    OSVERSIONINFO   VerInfo;

    VerInfo.dwOSVersionInfoSize =   sizeof  (   OSVERSIONINFO);
   
    GetVersionEx(   &VerInfo);
   
    if  (   VER_PLATFORM_WIN32_NT   ==  VerInfo.dwPlatformId)
        {
            // NT
        }
     else   // 9x
0
 
LVL 86

Expert Comment

by:jkr
ID: 2751334
BTW: Differentiating between 95 and 98 is also possible, but requires evaluating the build number - feel free to ask if you need to do that also...
0
 

Author Comment

by:rdno
ID: 2751344
Ok thanks... differentiate 98/95 can be read out of the registry... But this was all I Needed, thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now