如何使用 Delphi 调试 Windows 服务? [英] How to debug a windows service with Delphi?

查看:29
本文介绍了如何使用 Delphi 调试 Windows 服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法用 Delphi 完全调试 Windows 服务?

Is there a way to debug completely a windows service with Delphi?

推荐答案

您可以使用 Colin Wilson 的 NT 低级实用程序(页面不见了,在回程机中可用)

然后在 DPR 中:

begin
  if (paramCount > 0) and (SameText(ParamStr(1), '-DEBUG')) then
  begin
    FreeAndNil (Application);
    Application := TDebugServiceApplication.Create(nil);
  end;

  //... the rest of the normal DPR code
end.

通过这种方式,您可以在带有调试功能的 Delphi 中运行(通过设置项目调试器参数)、将 EXE 用作服务,或使用 -DEBUG 开关从命令行运行,以及 .

This way you can run from within Delphi with debugging (by setting the project Debugger Parameters), use the EXE as a service, or run from the commandline with the -DEBUG switch, and .

这篇关于如何使用 Delphi 调试 Windows 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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