Solved

NT/98/95 OS detection

Posted on 2000-04-26
3
184 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

762 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

22 Experts available now in Live!

Get 1:1 Help Now