?
Solved

C++ Have program run itself at a given time.

Posted on 2009-04-16
6
Medium Priority
?
424 Views
Last Modified: 2013-12-14
I'm working on a sort of service type program in which the user would at some point set the time at which he wants the executable of the program to start back up.

How would I go about doing this? Would it involve saving a beacon in some Windows file?
0
Comment
Question by:Cyber-Dragon
  • 3
  • 2
6 Comments
 
LVL 40

Assisted Solution

by:evilrix
evilrix earned 1332 total points
ID: 24165424
>> How would I go about doing this? Would it involve saving a beacon in some Windows file?
Have you tried looking at the Windows tack scheduler?
http://support.microsoft.com/kb/308569

The alternative is to have the process always running as a daemon or service, sleeping until the given time it is next due to run.
0
 
LVL 40

Accepted Solution

by:
evilrix earned 1332 total points
ID: 24165436
>> Have you tried looking at the Windows tack scheduler?
Heres the relevant SDK documentation for the Windows task scheduler.
http://msdn.microsoft.com/en-us/library/aa383614.aspx
0
 
LVL 1

Assisted Solution

by:jbachmanNET
jbachmanNET earned 668 total points
ID: 24165440
Hi Cyber-Dragon,

I'm assuming that you are programming a Windows application. If this is the case I think the best approach would be to use the Windows Task Scheduler.  You can read a little more about it and how to use it here:

http://www.codeproject.com/KB/system/taskscheduler.aspx

Good Luck!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Closing Comment

by:Cyber-Dragon
ID: 31571317
Found the resources I was looking for.
0
 

Author Comment

by:Cyber-Dragon
ID: 24189103
Unfortunately after reading up all these sources and Googling, I havnt been able to come up with anything useful. Could some one please post a code sample?
0
 
LVL 40

Expert Comment

by:evilrix
ID: 24191582
>> Could some one please post a code sample?
Having never used the Scheduler API myself the best I can do is point you a the API, which I've already done. Sorry.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question