In the release version of my code one line is throwing an exception and I don’t know what type of exception it is so I can’t catch it correctly or figure out the problem.
I using the catch(…) but that’s pretty much worthless.
here is some pseudo code
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");
}
So, is there any way to get any details on the thrown unknown exception? Just a type would be great.
thanks
Not really, it could be an
int, aconst char*or aRhubarbPieüber-smart pointer.However:
std::exceptiontoo. That will catch a lot of C++ native exceptions.(Update: MFC apparently uses throw-and-catch by pointer. That works too, as long as you catch what is thrown.)