Discussion:
Managed/unmanaged code exceptions handling tool (C# / С++)
(too old to reply)
Renat Letfullin
2010-03-22 15:12:20 UTC
Permalink
Hi,
We have application combining managed and unmanaged code (C# / C++).
It is neccessary to implement exceptions handling for this
application. We planning to implement it as a tool (or couple - for
managed and unmanaged parts) that will catch unhandled exceptions,
all
information about them (including process, thread info, call stack
and
so on).
Maybe someone can prompt the best way to implement this?
Ben Voigt [C++ MVP]
2010-03-22 17:06:09 UTC
Permalink
Post by Renat Letfullin
Hi,
We have application combining managed and unmanaged code (C# / C++).
It is neccessary to implement exceptions handling for this
application. We planning to implement it as a tool (or couple - for
managed and unmanaged parts) that will catch unhandled exceptions,
all
information about them (including process, thread info, call stack
and
so on).
Maybe someone can prompt the best way to implement this?
Managed exceptions are built on top of Win32 Structured Exception Handling.
C++ exceptions are too, if you compile with /EHa (or /clr, which forces
/EHa).
Win32 generates some exceptions of its own (access violation, etc). These
also appear as SHE.

If you have an SEH exception filter active (use Visual C++ __try/__except or
SetUnhandledExceptionFilter) then you can use the GetExceptionCode and
GetExceptionInformation built-ins to get an exception context. Then
imagehlp and some other APIs can get you the call stack including function
names and line numbers, etc.
Post by Renat Letfullin
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4965 (20100322) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4965 (20100322) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Loading...