Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi, I have developed a windows service and installed it but the thing is I want the service to perform some actions over and over again. I thought of using the OnContinue event but it fires only when the service has been manually paused and then resumed. When I let the code in on the OnStart event the service fails to start as the event doesn't return anything. Any help?
Posted
Comments
[no name] 23-Jun-13 11:44am    
You would need to spawn a thread to do this action over and over. How do you know your service does not start? Are you logging anything? Does it start and immediately exit? Does it not really start?
Sergey Alexandrovich Kryukov 23-Jun-13 12:27pm    
This would be a correct answer to post. You could also add that start and stop events are invoked on the start and before stopping of the whole process.
—SA
Ian A Davidson 23-Jun-13 16:58pm    
I agree with SA. Getting the OnStart event to create a thread and the OnStop event to cause the thread to finish is the right answer, so you should post it as a solution.
Ian.

You can use the timer controller to revoke automatically again.
For example: cycle 5minutes for 1 time

Please see may help you
http://support.tronganh.com/viewtopic.php?t=332[^]
 
Share this answer
 
I used threading to solve the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900