Thanks for that Peter, Kerry got me going.

By the way, a D5 service doesn't seem to need to be interactive to look at
the registry.

Ta,
Dave.

-----Original Message-----
From: Peter G Jones [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 11 November 1999 19:37
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Service Application not Stopping


Ok, you can use sleep but you must also call ServiceThread.ProcessRequests.

This method lets the scum (service control manager) that you haven't died 
and without it you will not receive any events from it.

With D4 there is a trick bit of code you need to stop the service from 
shutting down when yuou logout, if the service is interactive and 
non-console.  It needs to be interactive if you want to acccess things like 
the registry or desktop.  I don't have the code on me but if you email me at

[EMAIL PROTECTED] and remind me I'll dig it out for you plus a 
small sample.

Cheers


>From: David O'Brien <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
>Subject: RE: [DUG]: Service Application not Stopping
>Date: Wed, 10 Nov 1999 09:14:48 +1300
>
>OK... I seem to have struck a blank here. Thanks to Peter for his reply, 
>but
>I am obviously missing the point with NT services.
>
>Can anyone send me an example of a simple service that can start and stop?
>
>Its either poorly written help, misunderstood terminology or a lack of
>alcohol that makes me totally unable to see the answer here.
>
>Cheers,
>Dave.
>
>-----Original Message-----
>From: David O'Brien [mailto:[EMAIL PROTECTED]]
>Sent: Monday, 8 November 1999 13:20
>To: Multiple recipients of list delphi
>Subject: RE: [DUG]: Service Application not Stopping
>
>
>I went File|New|Service Application. This produced a TService in which I
>have put the code in the OnExecute Event. There is no ProcessRequests in a
>TService. Do I have to create a TServiceThread? If so, what is a TService
>for?
>
>What I am trying to achieve is a service that polls a folder looking for
>certain types of files, and processing them. This is basically a loop with 
>a
>sleep(1000).
>
>Dave.
>
>-----Original Message-----
>From: Peter G Jones [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, 9 November 1999 01:16
>To: Multiple recipients of list delphi
>Subject: Re: [DUG]: Service Application not Stopping
>
>
>What's in the your on Execute event?  Are you calling the
>ServiceThreads.ProcessRequests?
>
>
> >From: David O'Brien <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
> >Subject: [DUG]:  Service Application not Stopping
> >Date: Mon, 8 Nov 1999 11:20:32 +1300
> >
> >I have created a service apllication in D5Pro, and can install and start
> >the
> >service happily in NT4 SP5. However, I cannot stop the service. The D5 
>Help
> >is no help to me here.
> >
> >Where do you put code to terminate the service when the service is 
>stopped
> >from the services manager? (and what is the code?)
> >
> >I have a loop in the OnExecute event which has a boolean global variable
> >controlling it. The help says when the Execute code finishes the service
> >will stop. So in the OnStop event I set the Boolean false, and say 
>Stopped
> >:= True.
> >
> >What am I missing. (First time with services).
> >
> >Thanks in advance,
> >David O'Brien.
>
>---------------------------------------------------------------------------
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to