【发布时间】:2012-08-21 09:37:12
【问题描述】:
我正在使用 SetDllDirectory() 并想知道如何为 Windows 7 HP 64 位定义一个指令,我在想这样的事情:
在预处理器指令中:
Add WIN7
在 .cpp 中,我想添加类似
的内容#ifndef WIN7<- where the function is used
SetDllDirectory();
#endif
但只要我添加语句,SetDllDirectory 就会被注释掉。
这是我尝试过的,我在预处理器定义中添加了 WIN7 并添加了:
#if defined(__WIN7__)
if (regkeyExists) {
if (regkey->HasValue("LibPath")) {
regkey->QueryValue("LibPath", value);
if (!value.empty()) {
wxSetEnv("ABCLib", value);
SetDllDirectory(value.c_str());
}
}
}
SetDllDirectory("C:\\Program Files\\ABC\\ABCProject\\lib");
#endif
这是声明windows 7的权利吗
谢谢
【问题讨论】:
-
SetDllDirectory becomes commented.你到底是什么意思 -
SetDllDirectory() 不存在了,其实我是在代码里面使用#语句
标签: c++ compiler-errors preprocessor-directive