如何检测#Import dll
How to detect #import of a DLL?
我们希望根据是否针对特定的DLL执行#import
在代码周围进行一些条件编译。如果有#define
创建的符号,可以很容易地测试,但是我们没有找到任何符号。
A.H:
#ifdef ... // what goes here?
// do something with testing.dll
#else
// do some alternate stuff
#endif
x.cpp:
#import "testing.dll"
#include "A.h"
y.cpp:
#include "A.h"
我不认为这是可以实现的,这就是为什么:在编译时间在编译器宏解决时,在运行时加载了DLL,因此,在我的理解中,我认为您无法实现此行为。
相关文章:
- 挂起和取消挂起一个文件DLL
- std::threads可以从Windows DLL中的全局变量创建/销毁吗?
- 导入库可以跨dll版本工作吗
- 从C++dll访问C#中的一行主要参数
- 链接到自行创建的dll失败
- 为什么使用 P/Invoke 调用 dll 时,某些计算机中的 LoadLibrary 失败?
- 在调用FreeLibrary后,释放动态链接到具有相同版本的CRT堆的DLL的内存
- 如何指定我希望我的LIB链接到的DLL文件?-Visual Studio 2019
- 如何将图像传输到c++(dll)中的缓冲区,然后在c#的缓冲区中读/写
- C++:将外部库链接到dll库
- 在 Windows 上,是否可以让 dll 在不使用 PATH 环境变量的情况下在另一个文件夹中查找依赖项?
- 不同的Visual Studio版本中缺少.dll
- 从DLL中删除类的实例
- 如何包装第三方DLL在R中使用
- 使用c#访问c++dll中带有char*参数的函数时发生AccessViolationException
- 系统.将数组移交给c#中动态加载的c++DLL时发生AccessViolationException
- 如何检测#Import dll
- Labview DLL Import
- c++ to c# dll import ReadImage
- Import c++ DLL to c#