SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Task Scheduler service disabled

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> VCL Scheduling Agent
View previous topic :: View next topic  
Author Message
lterb



Joined: 09 Jan 2007
Posts: 4

PostPosted: Tue Jan 09, 2007 4:19 pm    Post subject: Task Scheduler service disabled Reply with quote

Please forgive my English (I am using an online translator) and my doubt, I am not a professional developer, like all of you. Embarassed

I wrote a simple application, using Delphi 7 Personal and Scheduling Agent v1.0.5 (registered), and it works well.

But if the Task Scheduler service in Windows XP SP2 is disabled and stopped, the application does not start (the Demo of Scheduling Agent does not start either), and return the error "Task Scheduler service is not running".

I have made a modification in saTask.pas, procedure TTaskScheduler.SetActive:

begin
// if (Value) then -> old line
if (Value) and (StartScheduler) then // -> modification
Open
else
Close;
end;

With that modification, the application starts when the Task Scheduler service is disabled, so a custom error message can be shown if the user try to use the "Edit Task" function and the other functions of the application can be used.

My doubt is: this goes to cause some malfunction in Scheduling Agent?

Thank you in advanced!
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Tue Jan 09, 2007 5:18 pm    Post subject: Reply with quote

Hello,

Actually, StartScheduler will start the Scheduler service and this is why your application started to work. I would recommend you the following:
1. Set Active property of TaskScheduler component to False at design-time.
2. In OnCreate event of your form activate it using
Code:
try
  TaskScheduler1.Active := True;
  except
... Add here some actions in case Scheduler was unable to start.
  end;

or
Code:
if TaskScheduler1.SchedulerServiceRunning then
    TaskScheduler1.Active := True
  else
  begin
    if TaskScheduler1.StartScheduler then
      TaskScheduler1.Active := True
    else
      ShowMessage('Unable to start Scheduler service!');
  end;

Please note: this might cause some problems on some users who "doesn't like@ your app start Scheduler Service. So it may be worth to ask them after checking the return of SchedulerServiceRunning method.
Hope this helps.
Back to top
View user's profile Send private message
lterb



Joined: 09 Jan 2007
Posts: 4

PostPosted: Tue Jan 09, 2007 9:17 pm    Post subject: Reply with quote

Thank you very much for your fast response!

I have tested your recomendation, but it does not work, the application does not initialize, it shows an error message, and another, and another, and finally ends the messages, but does not start at all.
The demo of Scheduling Agent shows two error messages and does not start either.

Sorry, but is the StartScheduler capable of initialize the Task Scheduler service if it is not only stopped, but also disabled?
I am asking that because if it is, I will have to discovery why in my tests it is not.

Thank you again.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Wed Jan 10, 2007 3:55 am    Post subject: Reply with quote

StartScheduler starts scheduler only if it is stopped. If service is disabled I guess it won't be able to start it. Sorry.
Back to top
View user's profile Send private message
lterb



Joined: 09 Jan 2007
Posts: 4

PostPosted: Fri Jan 12, 2007 10:46 pm    Post subject: Reply with quote

It's ok, it's not a problem, the Scheduling Agent is a fantastic component! Very Happy

Actually, I would only like to know if this small modification in saTask.pas,
which I described in my first post, will cause unexpected problems in
Scheduling Agent. What do you think about this?

Please excuse me to disturb you again with the same question!
Thank you.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Sat Jan 13, 2007 8:36 am    Post subject: Reply with quote

Hello,

No, your modification shouldn't cause any problem except it will be deleted in case of future upgrades. So just please be sure to record them and apply once you download updated versions from us.
Back to top
View user's profile Send private message
lterb



Joined: 09 Jan 2007
Posts: 4

PostPosted: Sat Jan 13, 2007 8:29 pm    Post subject: Reply with quote

I will do that.

Thank you very much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> VCL Scheduling Agent All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group