最近偶然用到一个结构体:SCROLLBARINFO ,编译(用到VC6+SP6)时无法通过,提示未找到其定义。仔细查看了一下API文档,提到:
HeaderDeclared in Winuser.h, include Windows.h
Minimum operating systemsWindows 98, Windows NT 4.0 with Service Pack 6
觉得没啥问题啊,只好把Winuser.h打开来看了看,发现居然要求WINVER>=0x500,而VC6提供的API的windows.h里的默认版本定义是0x400(VC7带的API头已经升到0x500以上了)。
于是,只好自已强制预定义了。 #define WINVER 0x500。编译OK,VC6出现如下提示:
NOTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications. To build a retail application,
set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk
to see if retail Windows NT 5.0 or Windows 98 headers are available.
See the SDK release notes for more information.
其实,不用理它,都什么年代了,文中提到的Windows版本可以不管它了。我想这也是MS的VC6多年不发展,带来的问题吧。想想VC6已经是好多好多年前的产品了。
石头于 2005-03-19