Page 1 of 1

StartScheduler v. Open

Posted: Sun Jun 20, 2004 10:46 am
by CarlDippel
TaskScheduler has two similar methods:

Code: Select all

function StartScheduler: Boolean;
and

Code: Select all

procedure Open;
Is there a difference other than the obvious, one is a function and the other is a procedure? When should I use one as opposed to the other? -Carl

Carl Dippel carl@dippel.us www.dippel.us/carl

Posted: Mon Jun 21, 2004 7:07 am
by isiticov
StartScheduler checks if Task Scheduler Service is working and in case not starts this service. This function "silently" checks if service is working.
Open calls StartScheduler and initializes Scheduler interface. In case of any error it raizes excpetion.

So to code in "good" way it would be useful to call StartScheduler firstly before calling Open and in case StartScheduler returns False then to show warning message to user that under his account it is impossible to use/start Scheduler service.