Click to See Complete Forum and Search --> : Schedule API?
fenglimin
December 24th, 2002, 08:53 PM
Hi,
I want to run a piece of code at the specific time, could you tell me whether the windows schedule API can do this? I have checked the MSDN, it seemed that the windows schedule API can only schedule a program ( such as a .exe file ). Am i right? How can i do?
Thanks!!
Bengi
December 25th, 2002, 09:55 AM
define the meaning "Run Piece of code" ???
sorry but its weird.
u mean, at xx:xx:xx do{ for(i=0;i<10;i++) {} } ?????
fenglimin
December 25th, 2002, 08:25 PM
Thank you Bengi!!
"a piece of code" just means a user defined function. I want to schedule a function, not a executable file. Because I have many functions to be scheduled, maybe it is not a good way to compile all these functions to executable files.
Thanks again!!
Bengi
December 26th, 2002, 01:47 AM
well,
it doesn't seems real.
because onces u have wrote a function into your source code, and make a compliation, the linker will put all the functions onto the EXE whatever u want or not..
so basically what u wanna do is unreachble.
willchop
December 30th, 2002, 04:05 PM
fenglimin,
I'm not familiar with the Windows Sceduling API , but maybe
you can do what you want without it. It looks as though you
want your program to execute a branch of code at a certain
time without resorting to calling another program. How about
having your program set a timer that will go off once every
minute or so and check the system time against the time you
want to run your function. If the system time is greater than
the run function time, then call your function.
regards, willchop
fenglimin
December 30th, 2002, 07:27 PM
Thank you!!
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.