How Can I Debug Access Violations When Running My Program Standalone?

Full Problem Description: My program runs fine in the Visual C++ environment, but when I run it standalone with Windows, it produces an access violation. How can I debug this problem?

Use Just-in-time debugging. If you set the Just-in-time debugging option before you compile, you can run your program standalone until the access violation occurs. Then, in the Access Violation dialog box, you can click Cancel to start the debugger.

Also see the Knowledge Base article Q133174, “How to Locate Where a General Protection (GP) Fault Occurs.” Knowledge Base articles are available by connecting to:

https://www.microsoft.com/kb/

Choose a Microsoft product (Visual C++), enter the article ID (Q-number) and click Retrieve Article.