本文介绍了如何在VS2015中配置ATL跟踪级别和类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我想在我正在VS2015(社区版)中构建的项目中跟踪ATL注册商流程.在此帖子(第三段),它说ATL/MFC跟踪工具已被删除.

I want to trace the ATL registrar process in a project I'm building in VS2015 (community edition). In this post (third paragraph) it says that the ATL/MFC trace tool has been eliminated.

不幸的是, VS 2015文档并未反映出这一变化.仍在讨论跟踪工具(备注"下的第一段).

Unfortunately the VS 2015 documentation does not reflect that change. It still talks about the trace tool (first paragraph under Remarks).

我的问题是,您如何指定要查看与ATL注册商相关的所有消息?

My question is how do you specify that you want to see all messages related to the ATL registrar?

推荐答案

我研究了ATL(作为VS的一部分安装)的源代码.特别是atltrace.h.我发现了:

I studied the source code for ATL (which is installed as part of VS). In particular atltrace.h. I found this:

  1. CTrace类控制要跟踪的类别和跟踪级别
  2. 静态未签名成员m_nLevel是跟踪级别.
  3. m_nLevel的值越小,导致跟踪越多.
  4. 归零导致所有迹线输出
  5. 值CTrace :: DisableTracing显式禁用所有 追踪
  6. 静态未签名成员m_nCategory是位掩码
  7. 模板类CTraceCategoryEx预先定义了23种不同的类别
  8. TraceUser和TraceUtil类别均为0x80000.我认为这是一个错误,TraceUser应该为0x800000
  9. CTrace :: GetLevel()获取当前跟踪级别.默认值为零
  10. CTrace :: SetLevel()设置跟踪级别
  11. CTrace :: GetCategories()返回类别位掩码
  12. CTrace :: SetCategories()设置类别位掩码
  13. 对于给定的跟踪级别和类别CTrace :: IsTracingEnabled()返回启用信息
  14. CTrace :: RegisterCategory()注册具有给定名称和索引的类别
  15. 用户定义类别有9个插槽.
  16. 如果未在atltrace.h CTrace之前定义_DEBUG.
  17. 在670行代码中,少于20条左右的注释.
  18. 不超过5条注释对于理解代码操作很有用
  19. CTrace中有一个奇怪的枚举,它定义了几个不相关的常量.
  20. 常量EnableAllCategories(无符号int作为位掩码)和DisableTracing(无符号int)具有相同的值,并且一个分配给另一个.
  1. The class CTrace controls which categories are traced and the tracelevel
  2. The static unsigned member m_nLevel is the trace level.
  3. Lower values of m_nLevel cause more tracing.
  4. Zero causes all traces to be output
  5. The value CTrace::DisableTracing explicitly disables all tracing
  6. The static unsigned member, m_nCategory, is a bit mask
  7. The template class CTraceCategoryEx pre-defines 23 different categories
  8. TraceUser and TraceUtil categories are both 0x80000. I think this is a bug and TraceUser should be 0x800000
  9. CTrace::GetLevel() gets current trace level. Default is zero
  10. CTrace::SetLevel() sets trace level
  11. CTrace::GetCategories() returns category bit mask
  12. CTrace::SetCategories() sets category bit mask
  13. For a given trace level and category CTrace::IsTracingEnabled() returns enablement
  14. CTrace::RegisterCategory() registers a category with given name and index
  15. There are 9 slots for user defined categories.
  16. If _DEBUG is not defined before atltrace.h CTrace is not defined.
  17. There's less than twenty or so comments in 670 lines of code.
  18. Not more than 5 comments are useful in understanding code operation
  19. There is a bizarre enum in CTrace that defines several unrelated constants.
  20. 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.

回答我的问题:除了调试版本,不需要任何东西来查看与Registrar相关的所有跟踪记录,也不需要查看诸如DebugView之类的消息.

Answer to my question: nothing is needed to see all tracing related to Registrar, except debug build, and something to view messages, like DebugView.

这篇关于如何在VS2015中配置ATL跟踪级别和类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-09 02:54