I have a mixed-mode application in which I want to fire up the debugger if an error is found in the internal datastructures. Strange enough, the DebugBreak and __debugbreak functions don't seem to work as expected (the .Net framework seems to intercept the breakpoint exception, leading to all kinds of nasty side effects).
The solution of my earlier question (see http://stackoverflow.com/questions/3629783/behavior-of-debugbreak-differs-between-unmanaged-and-mixed-unmanagedmanaged-ap) seems to work for very simple situations, but not in my application (it just leaves my application hanging).
Luckily, I found out that executing System::Diagnostics::Debugger::Launch
seems to solve the problem. However, the place where I need to have this logic is used in both unmanaged as in mixed-mode applications. Also, calling managed code in the place where I want to put the logic is rather difficult.
Therefore: is there an unmanaged alternative for the System::Diagnostics::Debugger::Launch
function?