Windows Service Problem

squirrel

Member
Joined
May 12, 2003
Messages
13
Location
UK
Im not sure if Im 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 Ive 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 services processing logic in a separate sub, then from OnStart, spawn a thread that invokes your processing sub. That way, you dont tie up the OnStart sub.
 
Back
Top