我宣布:
Unit BaseGuardian
TBaseGuardianService = class(TService)
public
end;
我没有使用此定义定义任何dfm
。后来我做了:
unit Guardian
TGuardianService = class(TBaseGuardianService )
public
end;
implementation
{$R *.dfm}
和dfm的代码:
object GuardianService: TGuardianService
DisplayName = 'GuardianService'
end
但是当我关闭项目并重新打开delphi时出现的问题让我看到了像 TForm 这样的服务(datamodule)! (所以第一个错误说没有属性DisplayName
,然后我在设计器中看到一个表单)。我错过了什么?
这是dpr文件的内容:
program Guardian;
uses
Vcl.SvcMgr,
System.SysUtils,
Guardian in 'Guardian.pas' {GuardianService: TService},
BaseGuardian in 'BaseGuardian.pas' {BaseGuardianService: TService};
{$R *.RES}
begin
if not Application.DelayInitialize or Application.Installing then
Application.Initialize;
Application.CreateForm(TGuardianService, GuardianService);
Application.Run;
end.