Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 May : Using CreateProcess() in a service
| Subject: | Using CreateProcess() in a service |
| Posted by: | "Peter" (in..@accenttechnology.o.uk) |
| Date: | Thu, 17 May 2007 18:11:05 |
I am creating a service that exec's another app using CreateProcess().
The code builds the command line for the other app, exec's it with
CreateProcess and then waits for a file generated by the other app to be
ready.
When I run the test code via a delphi form as a user it runs fine: the
CreateProcess is executed, the file is built slowly, the dephi part of
my app waits for the file to be complete and the procedure is ended.
This it does as expected.
When I run it as a service the CreateProcess line of code is executed my
app then continues to the wait loop but does not progress. The command
executed by the createprocess only starts to run once the wait loop has
timed out and the service goes idle.
I have tried changing the creation flags from:
CREATE_NEW_PROCESS_GROUP and NORMAL_PRIORITY_CLASS
to
CREATE_NEW_CONSOLE and HIGH_PRIORITY_CLASS
but it makes no difference.
Any ideas?
Peter