StartScheduler v. Open

This forum is designated to discuss SiComponents Scheduling Agent.
Post Reply
CarlDippel
Posts: 15
Joined: Thu Nov 13, 2003 7:41 pm
Location: LI, NY
Contact:

StartScheduler v. Open

Post 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
Anonymity negates sincerity.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post 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.
Post Reply