Click to See Complete Forum and Search --> : Exception Handling


Shekhar Raut
April 21st, 1999, 07:50 AM
I get exception with Exception code: C0000005 ACCESS_VIOLATION in try block.

Since code is huge one, I want line number and file name where it is happening exactly.

How do we do it?

Rob Wainwright
April 21st, 1999, 04:05 PM
You can:

1) step through in the debugger to find out where the exception is being thrown.

2) Comment out the exception handler (and as long as there aren't further exception handlers in the call stack, the bug should be quick to find.

3) Litter your code with debug time assertion checking which will highlight areas where the code is incorrect

4) Split the code into separate functions and use exception handler on each.

5) Use a tool like Boundschecker

If you're debugging straight line code - i.e. no remote debugging, no multiple threads, no Direct X - it isn't normally too difficult to find exceptions. Its deciding what to do.

Hope the above helps.