Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetVersion() does not work

1 view
Skip to first unread message

Tommi Ylikulju

unread,
Mar 27, 1996, 3:00:00 AM3/27/96
to
Does anybody know why GetVersion() function does not work properly
in Windows 3.11? It returns value 3.10. In Windows 3.1 and 95 it
seems to work fine. My routine is like this:

m_Version = GetVersion();
sprintf(Temp, "%s \t%d.%d", "Windows version:",
LOBYTE(LOWORD(m_Version)), HIBYTE(LOWORD(m_Version)));

--
------------------------------------------------
| Tommi Ylikulju |
| The Raahe Institute Of Computer Engineering |
| E-mail: tyl...@ratol.ratol.fi |
-------------------------------------------------

Matt Arnold

unread,
Mar 28, 1996, 3:00:00 AM3/28/96
to
tyl...@ratol.ratol.fi (Tommi Ylikulju) writes:

> Does anybody know why GetVersion() function does not work properly
> in Windows 3.11? It returns value 3.10. In Windows 3.1 and 95 it
> seems to work fine. My routine is like this:

> m_Version = GetVersion();
> sprintf(Temp, "%s \t%d.%d", "Windows version:",
> LOBYTE(LOWORD(m_Version)), HIBYTE(LOWORD(m_Version)));

This is the intended behavior! Here's an except from a recent Micrsoft
Developer's Network CD-ROM...

[begin quote]

SYMPTOMS
========
The GetVersion Windows API function returns version 3.10 when in Windows
version 3.11.
CAUSE
=====
GetVersion still returns 3.10 while inside Windows for Workgroups version
3.11 because there were so many applications that were checking for the
version number and requiring that the application be run under version
3.10. Therefore, Microsoft decided to have the GetVersion function
continue to return version 3.10 in Windows version 3.11.
WORKAROUND
==========
To look for Windows version 3.11 from within Windows, use the
GetFileVersionInfo Windows API function instead of GetVersion.

[end quote]

When the above refers to GetFileVersionInfo(), they mean to use it on
USER.EXE, a key Windows DLL. Check for the "LegalCopyright" element
of USER.EXE's VERSIONINFO resource. This is a string item. In Window
3.11, it contains "3.11"; in Windows 3.1, it contains "3.1".

Don't blame this fiasco completely on Microsoft, blame it on developers
who hard-coded their apps to run only if GetVersion() returned 3.10. I
think MS made the right decision here. But, on the other hand, I also
think it would have also been a good thing to burn all those lame
developers by forcing them to update their hard-coded stupidity.

Regards,
-------------------------------------------------------------------------
Matt Arnold | | ||| | |||| | | | || ||
mar...@netcom.com | | ||| | |||| | | | || ||
Boston, MA | 0 | ||| | |||| | | | || ||
617.389.7384 (h) 617.576.2760 (w) | | ||| | |||| | | | || ||
C++, MIDI, Win32/95 developer | | ||| 4 3 1 0 8 3 || ||
-------------------------------------------------------------------------

Kevin D. Sandal

unread,
Apr 1, 1996, 3:00:00 AM4/1/96
to

Thank you.
--
------------------------ Kevin Duane Sandal -------------------------
| dre...@bcstec.ca.boeing.com | dre...@halcyon.com |
| http://webevt01.ca.boeing.com/dsc | http://www.halcyon.com/dreamer/ |
| 294-2849, 03-CF, 294-2333 [fax] | (206) 338-0658 [fax - home] |
| Distributed Systems Computing | "Heart to God, hand to man..." |
-----------------------------------------------------------------------
| "Speaking for The Company isn't in my job description..." |
-----------------------------------------------------------


0 new messages