DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

我们知道,MFC中可以调用宏TRACE等十分方便的输出调试信息到Visual Studio输出窗口,但C++中没人类似的函数,最近我在开发一个小程序时跟踪了一下MFC的TRACE宏,发现它映像了atltrace.h中的ATLTRACE宏,因些,我们也想在C++中使用TRace可以用如下方式:

#include <atltrace.h>
#define TRACE ATLTRACE

TRACE("");

在C++中可以直接使用下面的函数

OutputDebugString Function

 

Sends a string to the debugger for display.

 

Syntaxvoid WINAPI OutputDebugString( __in_opt LPCTSTR lpOutputString); Parameters
lpOutputString

The null-terminated string to be displayed.

Return Value

This function does not return a value.

posted on 2012-12-28 16:38  DoubleLi  阅读(7932)  评论(0编辑  收藏  举报