如何使vcxproj选项因Windows操作系统而异 [英] How to make vcxproj options vary based on Windows OS
问题描述
我想编辑vcxproj文件,可能还需要编辑一些源代码,以在Windows XP和Windows 7操作系统之间取不同的值.例如,我有在Windows XP的Excel 2003和Windows XP的Excel 2010中运行的代码. Windows XP.我想相应地将调试条目更改为关联的Excel可执行文件.我在哪里可以找到相关的文档来做到这一点?
I want to edit a vcxproj file and possibly some source code to take a different value when the OS is Windows XP versus Windows 7. For instance, I have code that I run under Excel 2003 in Windows XP and under Excel 2010 in Windows XP. I would like to change the Debugging entry to the associated Excel executable accordingly. Where would I find the relevant documentation to do this?
推荐答案
您的三个选择是:
1.使用诸如#ifdef EXCEL2003
等的语句进行条件编译.
2.有条件的运行时选择;这将使用一些运行时变量,例如:
Your three choices are:
1. Conditional compile using statements like#ifdef EXCEL2003
etc.
2. Conditional run-time selection; this would use some run-time variable like this:
if bExcel2003)
{
// do Excel 2003 stuff
}
3.您可以将(2)发挥到极致,并根据Excel版本使用不同的DLL.
3. You can take (2) to the extreme and have different DLLs depending on the Excel version.
这篇关于如何使vcxproj选项因Windows操作系统而异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!