Solved

Windows 98 Version string retrieval

Posted on 1998-08-17
4
203 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
Comment Utility
     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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

728 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

9 Experts available now in Live!

Get 1:1 Help Now