H
helpme2002
Unregistered / Unconfirmed
GUEST, unregistred user!
小弟在NT下写了一个SERVICE,其中用到了一个线程,该线程每一分钟运行一次,处理数据库
,运行“正常”,但我的NT却关不了机,老是要结束我的SERVICE进程(等待,立即结束,取消)
(我的这个SERVICE安装正常,在NT的服务面板中也启动,停止正常),WHY??????
procedure TService1.ServiceStart(Sender: TService; var Started: Boolean);
begin
// showmessage('ddd');
database.Create(false);
Started := True;
end;
procedure TService1.ServiceStop(Sender: TService; var Stopped: Boolean);
begin
//CoInitialize(nil) ;
database.Create(false).Terminate;
Stopped := True;
end;
procedure TService1.ServicePause(Sender: TService; var Paused: Boolean);
begin
database.Create(false).Suspend;
Paused := True;
end;
procedure TService1.ServiceContinue(Sender: TService;
var Continued: Boolean);
begin
database.Create(false).Resume;
Continued := True;
end;
procedure TService1.ServiceShutdown(Sender: TService);
begin
database.Create(false).Terminate;
end;
procedure TService1.ServiceDestroy(Sender: TObject);
begin
database.Create(false).Destroy;
end;
,运行“正常”,但我的NT却关不了机,老是要结束我的SERVICE进程(等待,立即结束,取消)
(我的这个SERVICE安装正常,在NT的服务面板中也启动,停止正常),WHY??????
procedure TService1.ServiceStart(Sender: TService; var Started: Boolean);
begin
// showmessage('ddd');
database.Create(false);
Started := True;
end;
procedure TService1.ServiceStop(Sender: TService; var Stopped: Boolean);
begin
//CoInitialize(nil) ;
database.Create(false).Terminate;
Stopped := True;
end;
procedure TService1.ServicePause(Sender: TService; var Paused: Boolean);
begin
database.Create(false).Suspend;
Paused := True;
end;
procedure TService1.ServiceContinue(Sender: TService;
var Continued: Boolean);
begin
database.Create(false).Resume;
Continued := True;
end;
procedure TService1.ServiceShutdown(Sender: TService);
begin
database.Create(false).Terminate;
end;
procedure TService1.ServiceDestroy(Sender: TObject);
begin
database.Create(false).Destroy;
end;