Atl Mfc Trace Settings File

Posted on -

Oct 08, 2009 Today, I am going to write about another Visual Studio debugging tool, the ATL/MFC Trace Tool. The current trace settings are saved into.TRC file. Visual C++ MFC and ATL. Configuration: Release Win32. 'Release comtest.pch' precompiled header file is from a previous version of the compiler.

MfcSettingsAtl mfc trace tool settings file

I studied the source code for ATL (which is installed as part of VS). In particular atltrace.h. I found this:. The class CTrace controls which categories are traced and the trace level. The static unsigned member mnLevel is the trace level.

Lower values of mnLevel cause more tracing. Zero causes all traces to be output. The value CTrace::DisableTracing explicitly disables all tracing.

The static unsigned member, mnCategory, is a bit mask. The template class CTraceCategoryEx pre-defines 23 different categories. TraceUser and TraceUtil categories are both 0x80000.

I think this is a bug and TraceUser should be 0x800000. CTrace::GetLevel gets current trace level. Default is zero. CTrace::SetLevel sets trace level. CTrace::GetCategories returns category bit mask.

Atl Mfc Trace Tool

CTrace::SetCategories sets category bit mask. For a given trace level and category CTrace::IsTracingEnabled returns enablement. CTrace::RegisterCategory registers a category with given name and index. There are 9 slots for user defined categories. If DEBUG is not defined before atltrace.h CTrace is not defined. Daimler career program.

Atl Mfc Trace Tool Settings File

There's less than twenty or so comments in 670 lines of code. Not more than 5 comments are useful in understanding code operation. There is a bizarre enum in CTrace that defines several unrelated constants. The constant EnableAllCategories (unsigned int as bit mask) and DisableTracing (unsigned int) happen to have the same values and one is assigned to the other. Answer to my question: nothing is needed to see all tracing related to Registrar, except debug build, and something to view messages, like DebugView.