我想在我的应用程序中使用OutputDebugString()
函数,并且希望在应用程序部署到现场时有选项将其显示在单独的查看器中。
也就是说,我不想改变标志并重新构建我的.exe文件来打开或关闭调试。
通过Google搜索,似乎DebugView应该可以处理这个问题,但是它和TraceTool都没有显示出这段代码的任何输出。
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
OutputDebugString(PChar('Hello, wurld'));
end;
end.
我已经阅读了文档,但没有结果,并且发现其他人也遇到了类似的问题,但是没有发布解决方案。
有解决方案吗?
DebugIntf
单元和其中包含的GExpertsDebugWindow.exe
应用程序。这些在 XE2 Starter (以及几乎所有其他版本的 Delphi)下工作。 - Ken White