Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C VisualStudio VC
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 30-Jul-12 0:32am
Tarun22560
Edited 30-Jul-12 0:39am
enhzflep38.5K
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Usually the Windows Task scheduler provides the better way to accomplish such a task.
  Permalink  
Comments
Tarun22 at 30-Jul-12 5:50am
   
can u give me a sample how to use task scheduler in windows service?
CPallini at 30-Jul-12 6:01am
   
Do you mean this?
http://msdn.microsoft.com/en-us/library/aa446861%28VS.85%29.aspx
Tarun22 at 30-Jul-12 6:01am
   
i am new to task scheduler concept can u give me a pseudo code if possible
Albert Holguin at 30-Jul-12 10:17am
   
Only downside is this is a Windows dependent solution... good one nonetheless.
CPallini at 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.
Albert Holguin at 30-Jul-12 13:22pm
   
It is a safe assumption, I just mention it so that the OP knows this. If for example, he wants his application to work across multiple platforms, he may want to seek a different solution... if not, this is a great solution.

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

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 BillWoodruff 173
3 PIEBALDconsult 160
4 CPallini 155
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 30 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100