在我的代码的发布版本中,一行抛出异常,我不知道它是什么类型的异常,所以我无法正确捕获它或找出问题.
我使用了catch(...),但这几乎毫无价值.
这是一些伪代码
try
{
m_mmwIPC = gcnew NiftyIPC(gcnew String("Monitor"), true);
}
catch (CException* e)
{
TCHAR szCause[255];
e->GetErrorMessage(szCause, 255);
CString errorStr = szCause;
RemoveLineFeeds(errorStr);
OutputDebugString(errorStr);
}
catch(...)
{
OutputDebugString(L"Unknown exception\n");
}
Run Code Online (Sandbox Code Playgroud)
那么,有没有办法获得抛出未知异常的任何细节?只是一种类型会很棒.
谢谢