Thanks Angus, in fact I likewise I have a simple switch at startup to
decide whether I'm running in GUI or service mode, which I share below
as a way of saying thanks to the 'list' as I did not take on-board the
fact that the Svcmgr::Application->CreateForm call means the TService
class is dervived from TObject item and that can have a TSslWSocket
component on it without any manual message pumps (rather than creating a
thread that then creates the SslWSocket):
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
//(TfrmMain::OnShow then creates the TService based object
Svcmgr::Application->CreateForm(__classid(<some class dervived from
Thanks to all
Follow us: @nSolve <http://www.twitter.com/nSolve>
33-35 Daws Lane
London NW7 4SD
Tel: +44 (0) 1993 40 20 11
Tel(US): +1 617 273 2304
On 29/07/2015 08:15, Angus Robertson - Magenta Systems Ltd wrote:
Should I be calling MessageLoop or ProcessMessages?
Neither, Delphi windows services are message driven just like Windows
Most of my windows services are actually dual GUI/service, with a simple GUI
does not require any interaction when run as a service. This makes testing
easier, since the program can be run under the Delphi debugger and then
a Windows service once it's working.
Originally I wrote a simple service starter application that runs a standard
application as a service (with a command argument) and waits for it to finish
stopping, and sends a message if told to stop. I still sell an application
this technique after 18 years.
The second generation used the SvCom environment from:
which creates a single application that can be run as a service or GUI, just
components on a form, jkust works, but it's commercial.
For new applications I use DD Service Application Framework written by one of
ICS developers, but his web site seems to be down at the moment. I think it's
Code Central but search is useless and brings up thousands of results.
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