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 

Setting Time using ITaskSettings interface

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



Joined: 12 Aug 2008
Posts: 23

PostPosted: Sat Sep 13, 2008 5:30 pm    Post subject: Setting Time using ITaskSettings interface Reply with quote

Using any method/property that takes a date/time as documented format (The format for this string is PnYnMnDTnHnMn etc) throws an exception.

At first i quessed i did it wrong, but i ran the provided Delphi Demo and tried to set a setting it gave the same exception.

see screenshot www.petrossa.com/error.jpg

Every tasksetting accepting these strings gets weird. I got it to accept PT1M for DeleteExpiredTaskAfter, but then it throws an EndBoundary exception. The task enddate has been set.
Back to top
View user's profile Send private message
petrossa



Joined: 12 Aug 2008
Posts: 23

PostPosted: Thu Sep 18, 2008 6:03 am    Post subject: Reply with quote

is there anyway of knowing if this post is under evaluation?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Thu Sep 18, 2008 7:17 am    Post subject: Reply with quote

yes, we're trying to reproduce this now.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Thu Sep 18, 2008 11:18 am    Post subject: Reply with quote

In C++ Demo project there is code under:

Code:
void __fastcall TMainForm::Runnotepadexeeachdayat09001Click(
      TObject *Sender)

which sets end date:
Code:
  Task->Triggers->Items[0]->EndDate = Date() + 30; // will be executed during 1 month
  Task->Triggers->Items[0]->HasEndDate = true;

Does it raises this error? If not, do you set the EndDate using the same way?
Back to top
View user's profile Send private message
petrossa



Joined: 12 Aug 2008
Posts: 23

PostPosted: Thu Sep 18, 2008 4:33 pm    Post subject: Reply with quote

EndDate in itself doesn't really cause any problems.
i use
FTask->Triggers->operator [](MultipleActionsIndex)->EndDate=TEndDate->AsDate();

where TEndDate is a TEdit decendant with a TDateTime as member, it returns a valid TDateTime at all times. And that works ok.

Just when i do:

FTask->TaskDefinition->Settings->Set_RestartInterval("PT10M");
or
FTask->TaskDefinition->Settings->Set_ExecutionTimeLimit("PT1H");
the exception as shown in the screenshot occurs.
I just mentioned enddate because at 1 time it accepted
FTask->TaskDefinition->Settings->Set_RestartInterval("PT1M");
but then threw a fit at enddate.
So the real prob is not enddate but all the functions which use the Formatstring just are not agreeable.

I never compiled the C++demo, i only compiled the DelphiDemo because it had Vista implemented. The screenshot is from the Delphi demo.

Addendum:

FTask->Triggers->operator [](CurAction)->GetStartVistaDateTime();
works perfect,
but
TDateTime Dt=FTask->Triggers->operator [](CurAction)->BeginDate;
throws:

class EConvertError Invalid argument to date decode, as do EndDate, StartTime.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Thu Sep 18, 2008 5:26 pm    Post subject: Reply with quote

Uhh, I thought you was referring any problem with our code.
You can try to pass fully encoded time string like: "P0DT0H1M".
Back to top
View user's profile Send private message
petrossa



Joined: 12 Aug 2008
Posts: 23

PostPosted: Fri Sep 19, 2008 4:17 pm    Post subject: Reply with quote

well, first thing i did before posting was trying:
PT1H
PT2H0M
P0M3D
P0Y0M1DT0H0M

which didnt work. So thats why i compiled YOUR delphidemo, tried to set the expiration limit with using your Properties Interface on an already preexisting task set by the native Windows TaskScheduler interface.

Didnt change a letter to the code. That gave me exactly the same error, as shown in the screenshot www.petrossa.com/error.jpg which shows your demo as you can see.
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