这个工具需要下载安装, 在进行程序调试时,是很方便的一个助手。
下面分别列出在c++和c#中使用什么命令去打印字符串,会在DebugView中输出显示。
C++中需要写的代码:
用OutputDebugString输出你想要的信息,需要引用头文件windowl.h
下面是我代码中用到的:
#include <atlstr.h> // 该头文件包含了对windows.h的引用
CStringA str; str.Format("m_entrefGroupMap.size = %u", m_displayGroupMap.size()); OutputDebugStringA(str); 库函数中的定义:
void WINAPI OutputDebugString(
_In_opt_ LPCTSTR lpOutputString);
C#中需要写的代码:
Debug.WriteLine
System.Diagnostics.Debug.WriteLine("Enter ViewViewModel!");