Some help with a window service
hey guys, I got a little question. I'm supposed to build a window service to do some stuff which I know how to do. I also have to send a message if the window service fails or is not responding. I know how to code to send the message. The question is that I do not know where to put this code. Do I put it in the Onstop method? Will that method execute if the service fails? if not, where should I put that code to send the message? I'm pretty new to window services.
Jennifer Saunders
Re: Some help with a window service
What are the conditions for a failure?
As for not responding, if your service locks up the last thing it is going to do is post a message about it ... :D Maybe you could run a separate thread that checks the CPU usage of the main thread over the last time period, and if it is (very) abnormally high then post the message from the monitoring thread.