Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Windows 98 Version string retrieval

Posted on 1998-08-17
4
Medium Priority
?
214 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

824 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