You may want to use the following references to add some debugging functionality to your program:
Exception Handling in Visual C++[
^]
_set_se_translator[
^] - allows you to convert an access violation into a C++ exception - it's usually a good idea to preallocate a buffer for exception information on a per thread basis to avoid calling the runtime libraries during this conversion.
Possibly calling
DebugBreak[
^] as appropriate.
This usually facilitates more efficient debugging - especially if there is a lot of concurrent activity in your program.
Best regards
Espen Harlinn