如何使用宏检测Windows SDK版本? [英] How to detect Windows SDK version using Macros?

查看:213
本文介绍了如何使用宏检测Windows SDK版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,希望在Visual Studio 2005、2008、2010及更高版本上进行编译,每个项目都配置为任何特定版本的Platform SDK.

I have a project that I'd prefer to compile on Visual Studio 2005, 2008, 2010 and later, each configured to any particular version of the Platform SDK.

http://msdn.microsoft.com /en-us/library/aa383745(v=vs.85).aspx  让我设置宏,该宏告诉Platform SDK我要定位的操作系统版本.

http://msdn.microsoft.com/en-us/library/aa383745(v=vs.85).aspx lets me set Macro's that tell the Platform SDK which version of the OS I want to target.

但是,我需要检测Windows SDK的版本,以便对于早期版本,我可以有条件地包括不存在或存在于其他位置的功能的定义.

However, I need to detect the version of the Windows SDK so that, for early versions, I can conditionally include definitions of functionality not present, or present in a different location.

在这种特定情况下,我试图检测何时使用单独的脚本可再发行文件来访问Windows脚本主机头,以及何时依赖于Windows SDK中的文件.

In this specific instance, I'm trying to detect when to use the separate scripting redistributables to access windows script host headers, and when to rely on the files being in the Windows SDK. 

 


    #include <windows.h>
    #if (????)
    #include <activdbg.h>
    #else
    // http://support.microsoft.com/kb/223389
    #include "scripting.exe/activdbg.h" 
    #endif


推荐答案

如果未设置,WINVER会按照您想要的方式工作它和_WIN32_WINNT明确.请参见SDK包含文件夹中的sdkddkver.h.
WINVER works the way you want it if you don't set it and _WIN32_WINNT explicitly.  See sdkddkver.h in the include folder of the SDK.


这篇关于如何使用宏检测Windows SDK版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆