about me
Google_search
hot
latest
photos
links
在Delphi中的Debug- OutputDebugString
来源:来自网络 作者:不详 日期:2011-09-02 热度:使用 Win32 API OutputDebugString函数可以实现调试打印,对于多线程函数的调试非常好用,如下所示:
1) 在windows单元中声明如下:
procedure OutputDebugString(lpOutputString:pAnsiChar);
2)使用示例:
procedure Tform1.Button1Click(Sender: TObject);
begin
//delphi 调试打印
//用View - Debug Windows - Event Log 来查看
OutputDebugString('hello,delphi print log...');
end;
3)如何查看打印信息
这个函数是Windows提供的,专门用来进行调试。调用后,将把字符串发送给当前的调试器,比如说IDE,调试器(Softice, ollydbg)等。对于Delphi来说,就是Delphi IDE本身。在程序运行的时候,可以通过View - Debug Windows - Event Log 来查看,如图:

4)其它的一些设置:tools-options-debugger option中将integrated debugging设置打勾,如下所示

↑ 返回顶部
Tags: Delphi windows
广告位招租,广告代号:gg468
上一页:Delphi 生成 不重复随机数!!!
下一页:
下一页:
↑ 返回顶部




![还你真实的开幕式!震撼美图[转]【连载】](/up_files/image/Article/2008/08/12/57015031.jpg)



