Hi,

I do it a little different but results are similar. I create my whole application in a single TObject. So this object can run in a GUI as a console application as a NTService.

For console application just App.Create; and run a message pump, for NTService the same: create the object and run message pump.

So whole debugging and testing is in the console application (or GUI as you wish) - if all is running OK, just recomile the Service and it's done. There is even no testing required with the Service because it is exacly the same object that is running.

Met vriendelijke groeten,
Wilfried

Op 29-07-15 om 09:15 schreef Angus Robertson - Magenta Systems Ltd:
Should I be calling MessageLoop or ProcessMessages?
Neither, Delphi windows services are message driven just like Windows 
applications.
Most of my windows services are actually dual GUI/service, with a simple GUI 
that
does not require any interaction when run as a service.  This makes testing 
vastly
easier, since the program can be run under the Delphi debugger and then 
installed as
a Windows service once it's working.

Originally I wrote a simple service starter application that runs a standard 
Windows
application as a service (with a command argument) and waits for it to finish 
before
stopping, and sends a message if told to stop.  I still sell an application 
using
this technique after 18 years.

The second generation used the SvCom environment from:

http://www.aldynsoftware.com/

which creates a single application that can be run as a service or GUI, just 
drop
components on a form, jkust works, but it's commercial.

For new applications I use DD Service Application Framework written by one of 
the
ICS developers, but his web site seems to be down at the moment.  I think it's 
on
Code Central but search is useless and brings up thousands of results.

Angus


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to