To catch such exceptions I think you'll need to use Structured Exception Handling SEH.
Try Catch For Bad Memory Access
Developing on Windows 10 Pro, Visual Studio 2022 Community.
I've noticed that accessing bad memory doesn't get caught with try and catch clauses.
It's treated as an unhandled exception and an box pops up telling me about the issue.
I'm having a problem right now with a bad pointer, probably to a deleted class instance.
I have a diagnostic with an edit window where I'm stuffing a lot of information that should help me find the guilty code.
It would be very nice to catch the exception and continue execution so I can scroll through that edit control.
Any suggestions?
Thanks
Larry