可可西

vc6工程转成vs2008的一个问题【WINVER not defined】

昨天在将一个vc6的mfc dll工程转成vs2008时(使用vs2008进行转换),在编译时提示如下问题:

WINVER not defined. Defaulting to 0x0600 (Windows Vista)

 

整个编译和链接过程没有其他问题,但在vs2008中使用该dll创建界面控件时,

控件背景刷新和字体颜色(颜色和背景颜色一样,只有选中这些字体时才能看到)存在问题。

在其生成的vs2008工程的stdafx.h最前面加入如下代码,问题得到解决。

#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.  
#define WINVER 0x0500 // Win2k  
#endif  

#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.  
#define _WIN32_WINNT 0x0500 // Win2k  
#endif

posted on 2011-09-26 09:57  可可西  阅读(3159)  评论(1编辑  收藏  举报

导航