Board index » delphi » Running a program as a service with WinNT 3.51

Running a program as a service with WinNT 3.51

How can I run a program written in Delphi 2 as a service ???

I found an example in C-language which uses functions from the
advapi32.dll (OpenSCManager, CreateService, ...), but when I use
this functions in Delphi, the compiler didn't recognize them.
In the Delphi-Helpfile these functions are described !?

How can I use this functions or has someone an example in Delphi ?

Also, I have to start my service after the SQL-Server service has started !
Can I manage the sequence in the control-panel ?

Can anyone help me with these problems please ?

Thanks Mark.

 

Re:Running a program as a service with WinNT 3.51


Mark Schoch <m...@schoch.vol.at> wrote in article
<01bc5f79$a7ba0980$c986b7c2@toms-compaq>...

Quote
> How can I run a program written in Delphi 2 as a service ???

> I found an example in C-language which uses functions from the
> advapi32.dll (OpenSCManager, CreateService, ...), but when I use
> this functions in Delphi, the compiler didn't recognize them.
> In the Delphi-Helpfile these functions are described !?

> How can I use this functions or has someone an example in Delphi ?

> Also, I have to start my service after the SQL-Server service has started
!
> Can I manage the sequence in the control-panel ?

> Can anyone help me with these problems please ?

> Thanks Mark.

There are a set of source files called NTSVC.ZIP which make writing WinNT
services a breeze. They were written a couple of years ago so I would say
that they work with NT 3.5 and up. As far as controlling the startup order,
I'm not sure but there may be a way to do it through the control panel,
I've never really cared so I haven't looked.

Geoff Bennett
geoffb @ pipeline.com.au
(Remove spaces arount at sign to email me)

Other Threads