Windows Service Problem

squirrel

Newcomer
Joined
May 12, 2003
Messages
13
Location
UK
I'm not sure if I'm posting this in the correct area, but I have written a Windows service. It installs fine, but whenever I start the service, the Service Manager tells me it fails, it locks itself up and the only way to stop it is through Task Manager, yet the service does actually run.

Service Manager always shows a status of Starting, but never Started. A right click on the service only returns me a menu with all menu items disabled.

Anyone shed any light on what I've done wrong?

TIA
 
Perhaps you are not exiting the OnStart sub. MSDN states that you should exit the sub as soon as possible and not do any long-running task in it. One way to do this is to put your service's processing logic in a separate sub, then from OnStart, spawn a thread that invokes your processing sub. That way, you don't tie up the OnStart sub.
 
Back
Top