Solved

NT/98/95 OS detection

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need some help with listview limit text 20 104
Getting IP address 8 79
convert char array to number in c 5 85
c++ getting the first 10 characters of a char* string 11 94
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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…
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 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.

777 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