我在 Visual Studio 2008 C++ 中遇到了一个奇怪的情况。我编写的代码最初是为 Visual Studio 2003 编写的,一切运行良好。现在,移植到 VS 2008,不幸的是,在代码中广泛存在的异常处理不再起作用。标准代码示例:
try { HRESULT hr = S_OK; // do stuff... if( FAILED( hr ) ) throw hr; } catch( HRESULT hr ) { // error handling, but we never get here } catch( ... ) { // ... not even here }
在VS 2008下,没有遇到异常,但是我在别的地方遇到了crash,说明堆栈指针一定是搞砸了。有人遇到过这种行为吗?任何帮助表示赞赏。