ATLTraceTool Sample: Displays Output of ATLTRACE2
The ATLTraceTool sample builds an application that specifies which ATLTRACE2 messages appear in the output window. This application, the ATL Trace Tool, displays debug trace messages in the ATL and MFC sources. You can control the type and amount of messages displayed.
AtlTraceTool.exe ships in Visual Studio and can be found in the \Program Files\Microsoft Visual Studio 9.0\Common7\Tools directory. AtlTraceTool.exe is also available from the Tools menu in the development environment.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.
To get samples and instructions for installing them:
On the Visual Studio Help menu, click Samples.
For more information, see Visual Studio Samples.
The most recent version and complete list of samples is available online from the Visual Studio 2008 Samples page.
You can also locate samples on your computer's hard disk. By default, samples and a Readme file are copied into a folder under \Program Files\Visual Studio 9.0\Samples\. For Express editions of Visual Studio, all samples are located online.
To build and run this sample
Open the solution file tracetool.sln.
From the Build menu, click Build.
From the Debug menu, click Start Without Debugging.
This procedure is optional. You can use the prebuilt AtlTraceTool.exe instead if you want.
To use ATLTraceTool.exe
Debug an MFC or ATL project by clicking Start from the Debug menu.
From the Tools menu, click MFC/ATL Trace Tool if it is not already running.
Expand the tree control list in the Trace List window. The window shows the running application, any modules within that application, and the trace categories for each module.
Customize, for each process, module, and category, which information is displayed in the output window. The Trace level control in the Process group is related to the ATLTRACE2 level; only those ATLTRACE2 messages with a level equal to or greater than the setting in the Trace level control will be displayed in the output window.
Click Apply to put your settings into effect.
You can save your settings and load them the next time you debug the application; use the Save and Load buttons.