Enabling Just-in-Time Debugging
With Just-in-time debugging, you can run a program outside Visual C++. When an application error occurs, it calls the Visual C++ debugger.
To enable Just-in-time debugging
From the Tools menu, click Options.
Select the Debug tab.
Select the Just-in-time debugging check box.
Click OK.
From the Build menu, choose Build <project>.exe.
Note If you are running Windows NT, you must have administrator privileges to set the Just-in-time debugging option.