Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

NT/98/95 OS detection

Posted on 2000-04-26
3
Medium Priority
?
193 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

824 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