tfRunOnlyIfLoggedOn Flag

This forum is designated to discuss SiComponents Scheduling Agent.
Post Reply
mike71
Posts: 4
Joined: Tue Jan 18, 2005 8:30 am

tfRunOnlyIfLoggedOn Flag

Post by mike71 »

SiComponents seems to have trouble clearing the tfRunOnlyIfLoggedOn flag in the Flags property of TTaskItem. I need my task to run even if the user is not logged in, so I need to clear this flag which seems to get set by default. I'm currently testing using the Delphi Demo app, but everytime I clear the this flag it simply ignores the instruction and resets it. I've verified that the Demo code is actually attempting to clear the flag, the change just won't seem to stick. Any ideas?

Thanks
mike71
Posts: 4
Joined: Tue Jan 18, 2005 8:30 am

Post by mike71 »

On a lark I recompiled the application under Delphi 7 (I had been using Delphi 2005) and the problem went away. Looks like it's a bug in the Delphi 2005 version of the components?
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Thank you for your information. We've found the reason for this. There is error in sources. For all who have registered version please modify sources of procedure TTaskItem.SetFlags(const Value: TTaskFlags); as following:
the last line of procedure before end; must be:

Code: Select all

OleCheck((FInterface as ITask).SetFlags(pdwFlags));
rcastle
Posts: 4
Joined: Fri Jun 10, 2005 2:11 pm

How about the Demo?

Post by rcastle »

I'm using the demo version of VCL Scheduling Agent and having troubles with this issue. Has the demo code been updated?

Here's an example of my code:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);

var
   TriggerDetails: TTriggerDetails;
   ST: TSystemTime;

begin
  TaskScheduler1.Active :=true;
  with TaskScheduler1.CreateNewItem(Format('New task %d', [GetTickCount])) do
  begin
    ApplicationName := '\\rpm_server3\rpm1\public\osver.exe';
    // create start time data
    DateTimeToSystemTime(Now, ST);
    ST.wHour := 1;
    ST.wMinute := 0;
    ST.wSecond := 0;
    ST.wMilliseconds := 0;

    SetAccountInformation('REELL\**********','**********');

    Flags := Flags - [tfRunOnlyIfLoggedOn];

    Triggers.Add;
    Triggers[0].TriggerType := ttOnce;
    Triggers[0].StartTime := SystemTimeToDateTime(ST);
    Triggers[0].BeginDate := Date+1;

    TriggerDetails.Daily.DaysInterval := 1;
    Triggers[0].Details := TriggerDetails; // trigger details must be changed only this way
    // could be used UpdateTriggers and Save
    Triggers.UpdateTriggers;
    Save;
    // or just Deactivate(True)
    //Deactivate(True);
  end;
  TaskScheduler1.Active := false;
end;
Thanks,

Randy
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Thank you for notice! Indeed due to script error this was not included. We will update demo build shortly. Registered sources are already updated.
Thank you again.
Best regards,
Igor Siticov.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

FYI: Trial version just updated as well. Thank you again!
Best regards,
Igor Siticov.
rcastle
Posts: 4
Joined: Fri Jun 10, 2005 2:11 pm

Still having trouble

Post by rcastle »

I downloaded the demo again and tried it. Same problem. I then removed the Delphi package and reinstalled it. Same problem. Removed the component from the canvas. Still problem. Recommendations?

By the way - that's a very fast response. If I can get this to work I'll be buying a copy.

Thanks,

Randy
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

As we've received you order, I guess it works now for you?
Best regards,
Igor Siticov.
rcastle
Posts: 4
Joined: Fri Jun 10, 2005 2:11 pm

Post by rcastle »

Actually, I decided $30 was worth giving it a shot even if the demo wasn't working. The file I downloaded was still dated 20 May. The real version seems to be working ok.

Randy
rcastle
Posts: 4
Joined: Fri Jun 10, 2005 2:11 pm

Post by rcastle »

I just checked the download site and the date has changed. I assume it would work with the demo now but I can guarantee it works with the purchased version. This VCL control is doing exactly what I needed and the support is first rate. Spend the $30!

Randy
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

I guess, this was either proxy or cache issue. Since right before posting to the forum the download page on web site and file itself was updated to the newer content.
Thank you for your good words.
Best regards,
Igor Siticov.
Post Reply