Click here to Skip to main content
15,886,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am developing a service in C++ and a GUI in C#.

The service and GUI will interact through INI, there is an option in GUI to give time restart service at a particular time.
Now in my service I have to continuously check the time written in INI with current system time and restart the service if time matches.

To do so, should I create a thread?
Posted
Updated 29-Jul-12 23:39pm
v2

1 solution

Usually the Windows Task scheduler provides the better way to accomplish such a task.
 
Share this answer
 
Comments
Tarun22 30-Jul-12 5:50am    
can u give me a sample how to use task scheduler in windows service?
CPallini 30-Jul-12 6:01am    
Do you mean this?
http://msdn.microsoft.com/en-us/library/aa446861%28VS.85%29.aspx
Tarun22 30-Jul-12 6:01am    
i am new to task scheduler concept can u give me a pseudo code if possible
Albert Holguin 30-Jul-12 10:17am    
Only downside is this is a Windows dependent solution... good one nonetheless.
CPallini 30-Jul-12 11:15am    
Well, since the question is tagged with 'Visual Studio' and the OP mentions INI files, I suppose we may safely assume it is a service for the Windows platform.
Anyway, yes, of course you are right.

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