Solved

NT/98/95 OS detection

Posted on 2000-04-26
3
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

630 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