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 |
-------------------------------------------------
> 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 || ||
-------------------------------------------------------------------------
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..." |
-----------------------------------------------------------