在bcb6.0中调用vc写的动态库时,对接口文件进行了下修改,
下面代码中红色部分是在接口.h文件中新加入的
extern "C" int aa(int Length);
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef HRESULT (WINAPI *WM_AA)(int Length);
#ifdef __cplusplus
}
#endif
现在动态库改为bcb6.0写的了,我想还用这个调用方式,但是运行aa函数时就会出错,
project project1.exe raised exception class eaccessviolation with message 'access violation at address 00000000.write of address 000000000'.process stopped. use step or run to continue.
为什么不能调用,是不是函数本来就是c++写的了就不能用#ifdef __cplusplus了?还是其他方面有问题?知道的帮忙指点下,谢谢了。