OutputDebugString 是很常用的调试函数, 其作用是将指定的调试字符串, 在运行时输出到特定的位置, 以便我们能获知程序执行的情况. 其 MSDN: http://msdn.microsoft.com/en-us/library/windows/apps/aa363362(v=vs.85).aspx
其中比较重要的两点:
1. Applications should send very minimal debug output...
2. OutputDebugStringW converts the specified string based on the current system locale information and passes it to OutputDebugStringA to be displayed. As a result, some Unicode characters may not be displayed correctly.
在DELPHI XE2中使用发现了如下的bug:(当然导致这个故障的本身不是OutputDebugString函数本身,而是DelphiXE2 IDE问题所致。)
偶然发现WIN32 API函数 OutputDebugString调试字符串在Delphi XE2 控制台(Event Log)输出有1023字节长度限制。超出的部分显示不出来。如果用Debugview来接收就不会缺少字符。挺遗憾!
小技巧:
OutputDebugStrin