我想在我的应用程序中使用OutputDebugString()
,然后在应用程序部署到现场时可以选择在单独的查看器中显示它。如何查看OutputDebugString的输出?
也就是说,我不想更改标志并重建我的.exe来打开和关闭调试。
谷歌搜索,似乎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.
我已阅读文档,无济于事,看到其他人也有类似的问题,但还没有发布解决方案。
有没有解决方案?
[GExperts](http://gexperts.org)有一个调试查看器和一个添加到您的应用的单元,即使在XE2启动器中也会为您执行此操作。请参阅它包含的'DebugIntf'单元和'GExpertsDebugWindow.exe'应用程序。这些工作在XE2 Starter(以及几乎所有其他版本的Delphi)下工作。 –
+1我会检查出http://www.gexperts.org/tour/index.html?debug_window.html – Mawg
如果你张贴的答案,我可能会奖励它,尽管来自@RRUZ的英镑帮助这是我将与之合作的解决方案 - FOR EXE2 STARTER版本。它似乎是在IDE内外共同工作的唯一解决方案。对于其他版本,我可能更喜欢TraceToool的更多版本,但Gexperts看起来比我的需求更好。 – Mawg