Delphi中用OutputDebugString显示调试信息
作者:webfly 日期:2007-08-27
今天在看《ISAPI Filter 限制 IIS 多线程访问》源码时,发现多处使用了
{$IFDEF DEBUG}
OutputDebugString('Call IpIncrement ...');
OutputDebugString(PChar('IP in IpIncrement ...'+IP));
{$ENDIF}
这样的语法,看意思是输出调试信息,跟踪定义到了widows单元,有这么几个定义
procedure OutputDebugString; external kernel32 name 'OutputDebugStringA';
procedure OutputDebugStringA; external kernel32 name 'OutputDebugStringA';
procedure OutputDebugStringW; external kernel32 name 'OutputDebugStringW';
查找得到http://blog.csdn.net/dogbear2000/archive/2005/02/03/279485.aspx
有些时候,我们需要输出调试信息,但又不在界面上,也不希望弹出窗口中断执行,
这时,只要用OutputDebugString就可以了,然后在View|Debug Window|Event Log查看结果即可。
例子:
var S : string;
for I:= 1 to 10000 do
begin
....
OutputDebugString(PChar(S));
end;
文章来自: 本站原创
Tags: Delphi中 OutputDebugString 调试
相关日志:
上一篇
下一篇
