Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows 98 Version string retrieval

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

660 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