Solved

Windows 98 Version string retrieval

Posted on 1998-08-17
4
205 Views
Last Modified: 2010-04-01
Is there any API/Mechanism by which one can find out the version string in Windows 98? RegQueryValue()/GetVersion() were not producing desired results.
0
Comment
Question by:indranil
  • 2
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 0 total points
ID: 1170474
     OSVERSIONINFO osver;
      osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);

      DWORD ver = GetVersionEx(&osver);
      CString msg;
      msg.Format("%u.%u.%u", osver.dwMajorVersion, osver.dwMinorVersion, LOWORD(osver.dwBuildNumber));
      SetDlgItemText(IDC_VERSION, msg);
0
 
LVL 22

Expert Comment

by:nietod
ID: 1170475
I'm curious what was wrong with GetVersion()?  since I would guess it was implimented using GetVersionEx() it should return the same information (of the information it returns).
0
 
LVL 32

Expert Comment

by:jhance
ID: 1170476
To quote from the Win32 API Reference:

This function has been superseded by GetVersionEx, which is the preferred method for obtaining system version number information. New applications should use GetVersionEx. The GetVersionEx function was developed because many existing Windows applications err when examining the DWORD return value of a GetVersion function call, transposing the major and minor version numbers packed into that DWORD. The GetVersionEx function forces applications to explicitly examine each element of version information, and allows for future enhancements to that information.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1170477
I already read that part and was not suggesting that he use the old function.  I was wondering in what way the old function was "not producing desired results" and was wondering if the new one will be any better.  I.e. I'm wondering what the desired results are.  I was also wondering if MS did something "clever" and made the old function always return a certain value so that legacty apps don't find out they are running under a new OS.  (I would hope not.)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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.

770 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