Rules for writing services:
1. They must not have any interaction with the user or the desktop (ie. no popup windows, or for that matter, visual UI at all). If you need to communicate with the user, then a service is not what you should be writing.
2. In the OnStart event, start a new thread to do your real work. The OnStart event runs under the Service Control Manager, and if you take too long, it will mark your service as being non-responsive. So, doing things like doing a blocking read on a socket, or large DB query, is a bad idea.
Chip H.
____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.