在资源脚本中使用#define

时间:2015-03-23 00:27:56

标签: c++ windows header resources

我想在资源脚本中重新定义自动生成的值。我知道如何做到这一点,我做了在传统的Visual C ++ 6和Code :: Blocks中。这是我的Resource.rc文件的一般结构:

#include "resource.h" // automatically generated IDs
#include <windows.h> // carries definitions of basic constants
#include "redefinition.h" // redefinition of automatically generated IDs
... // body of the resource script

例如,Redefinition.h中的以下行将&#34;覆盖&#34;名为MY_VAL的符号ID具有更合适的值:

#define MY_VAL 100*50+22 // 5022

当我尝试在Visual Studio 2010 Express中使用相同的概念时,它可以忽略乘法!那就是:

#define MY_VAL 100*50+22 // VS sees 100+22 = 122
#define MY_VAL 50*100+22 // VS sees 50+22 = 72

括号无济于事!因此,对于Express版本是否存在任何约束,因为宏观评估仅限于在此上下文中添加/减少,或者我真的很愚蠢? (或者是微软的那些人?!)

非常感谢您的帮助/建议。

0 个答案:

没有答案
相关问题