Click here to Skip to main content
11,932,461 members (55,040 online)
Rate this:
Please Sign up or sign in to vote.
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
Edited 30-Jul-12 0:39am

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 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?
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.
Albert Holguin 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.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