This section covers the following topics pertaining to debugging C and C++ applications.
The DirectX SDK installation program provides the option of installing either debug or retail builds of the DirectX DLLs>.
When you develop software in C++, it is best to install the debug versions of the DLLs>. This option installs both debug and retail DLLs> on your system (the retail version installs only the retail DLLs>). The debug DLLs> have additional code that validates internal data structures and outputs debug error messages, using the OutputDebugString function while your program is executing. When an error occurs, the debug output gives you a more detailed description of the problem. The debug DLLs> run more slowly than the retail DLLs> but are much more useful for debugging an application. Be sure to ship the retail version with your application.
If you have the debug SDK installed, you can use the DirectX Control Panel utility to switch between the debug and retail builds of most components. To enable this feature, select the Debug option when you install the SDK.
To see the debug messages, configure your system so that debug output appears in a window or on a remote computer. A development environment such as Visual Studio .NET enables you to do this. Consult the environment documentation for setup instructions.
To ensure that the debugger can find the relevant symbolic information when using debug builds, locate the symbol files as follows:
.pdb file location: Same directory as binary
.dbg file location: %SystemRoot%\Symbols\<binary extension>\
If you installed the retail runtime and would like to change to the debug runtime, run Dxsetup.exe, which is located in the (SDK root)\Redist\ folder.
If you have the debug runtime and would like to revert to the retail runtime, run Undxxpdebug.exe, which is located in the Windows System folder. You can also run this by selecting Run from the Start menu and typing undxxpdebug in the box.
The Microsoft Application Compatibility Toolkit contains the tools and documentation you need to evaluate and mitigate application compatibility issues before deploying your application.
To find C++ memory corruption and other problems, you can use the Microsoft Windows Application Verifier (AppVerifier). The AppVerifier tool monitors an application for things like heap corruption, locks usage, and invalid handles. See the Testing Applications with AppVerifier Article for steps on how to use this tool.