我遇到了以下问题:有导出函数的 DLL。
这是代码示例:[DLL]
__declspec(dllexport) int openDevice(int,void**)
[应用程序]
开发者.h:
__declspec(dllimport) int openDevice(int,void**)
开发者.cpp:
try {
void *p = NULL;
int devError = openDevice(some_integer,&p);
if(devError)
throw (int)devError;
} catch(int i) {
cerr << "Device opening error: " << i << endl;
}
catch(...) {
//other handler
}
异常没有传递给 catch 块,我没有理由。请帮助解决这个问题。我正在使用带有 MSVC 9.0 的 Qt Creator。