Solved

Windows 98 Version string retrieval

Posted on 1998-08-17
4
207 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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 viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

733 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