Click here to Skip to main content
11,796,774 members (66,569 online)
Rate this: bad
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 29-Jul-12 23:32pm
Edited 29-Jul-12 23:39pm

1 solution

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

Solution 1

Usually the Windows Task scheduler provides the better way to accomplish such a task.
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?
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 Maciej Los 480
1 Abhinav S 369
2 OriginalGriff 360
3 CPallini 285
4 KrunalRohit 249
0 OriginalGriff 2,032
1 Maciej Los 1,725
2 KrunalRohit 1,310
3 CPallini 1,055
4 ppolymorphe 883

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 30 Jul 2012
Copyright © CodeProject, 1999-2015
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