如何查看OutputDebugString的输出? [英] How to view output of OutputDebugString?

查看:422
本文介绍了如何查看OutputDebugString的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中使用 OutputDebugString(),然后在应用程序部署在该字段中时,可以在单独的查看器中显示该选项。 >

也就是说,我不想改变一个标志并重建我的.exe来打开和关闭调试。



Googling,似乎 DebugView 应该处理那么,但是它也不是,而不是 TraceTool 显示此代码的任何输出。

  unit Unit1; 

接口

使用
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
{私人声明}
public
{公开声明}
end;

var
Form1:TForm1;

实现

{$ R * .dfm}


程序TForm1.FormCreate(发件人:TObject);
begin
OutputDebugString(PChar('Hello,wurld'));
结束

结束。

我已阅读文档,无效,并看到其他人遇到类似的问题,但有没有发布解决方案。



是否有解决方案?

解决方案

GExperts 具有调试查看器和您添加到应用程序中的单元,即使在XE2 Starter中也可以为此执行此操作。请参阅 DebugIntf 单元和包含它的 GExpertsDebugWindow.exe 应用程序。这些工作在XE2 Starter(和几乎所有其他版本的Delphi)下。



GExperts还包括大量其他IDE和编辑器增强功能,已经永远在周围,所以他们是非常可靠的工具。


I want to use OutputDebugString() in my application and then have the option to show it in a separate viewer when the application is deployed in the field.

That is to say, I don't want to have to change a flag and rebuild my .exe to turn debugging on and off.

Googling around, it seems like DebugView should handle that, but neither it, nor TraceTool show any output from this code.

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.

I have read the documentation, to no avail, and see that others have had similar problems, but have not posted a solution.

Is there a solution?

解决方案

GExperts has a debug viewer and a unit you add to your application that will do this for you, even in XE2 Starter. See the DebugIntf unit and the GExpertsDebugWindow.exe application that it includes. These work under XE2 Starter (and pretty much all other versions of Delphi).

GExperts also includes tons of other IDE and editor enhancements that are great, and of course they've been around forever, so they're pretty solid tools.

这篇关于如何查看OutputDebugString的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆