NT Service & NT Error 2140

Hi there!

I tried to program a NT service with delphi 4 which reads data from a
socket and writes to disk.
When I Run the service from delphi everything works fine but the service
is only available for about 5 seconds. What I read before is that this
might be ok.
But if I try to start the service in the SCM I get the error 2140
(internal WinNT-Error).

Is anybody out there who solved this problem?