Trolltech Home | Qt-solutions Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-solutions Archive, April 2008
Re: Problems starting a QtService


Message 1 in thread

Thomas Rock wrote:
> This works fine under Linux. Under windows, it starts the server but
> doesn't disconnect it from the starting process (i.e. command line).
> 
> What do I need to do to properly start a service, especially under windows?

Just saw your message (don't read this mailing list much). Under
windows, the service control starts the service, not the command line.
All I do is,

  SomeServive service( argc, argv );
  return service.exec();

in main. And it all works.

QtService handles all the issues regarding starting service, pausing,
resuming, other message handing, etc. In your example you do not do
this. The service's main processing loop is not started in your example.

Now, in Linux the situation is much simpler regarding services because
there is no message passing. All you have is a few signals (system not
Qt) that have their own handers and all you do is a fork(). Windows is a
different beast hence your approach doesn't work.


Hope this helps,
Adam

--
 [ signature omitted ]