加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

如何使用Delphi调试Windows服务?

发布时间:2020-12-15 10:18:36 所属栏目:大数据 来源:网络整理
导读:有没有办法使用Delphi完全调试Windows服务? 解决方法 您可以从 Colin Wilson’s NT Low Level Utilities使用unitDebugService.pas(页面已经没有, available in the wayback machine) 然后在DPR中: begin if (paramCount 0) and (SameText(ParamStr(1),'-D
有没有办法使用Delphi完全调试Windows服务?

解决方法

您可以从 Colin Wilson’s NT Low Level Utilities使用unitDebugService.pas(页面已经没有, available in the wayback machine)

然后在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开关从命令行运行。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读