Page 1 of 1

tfRunOnlyIfLoggedOn Flag

Posted: Tue Jan 18, 2005 5:39 pm
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

Posted: Tue Jan 18, 2005 5:48 pm
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?

Posted: Wed Jan 19, 2005 8:18 am
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));

How about the Demo?

Posted: Fri Jun 10, 2005 3:33 pm
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

Posted: Fri Jun 10, 2005 4:05 pm
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.

Posted: Fri Jun 10, 2005 4:46 pm
by isiticov
FYI: Trial version just updated as well. Thank you again!

Still having trouble

Posted: Fri Jun 10, 2005 5:27 pm
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

Posted: Fri Jun 10, 2005 6:17 pm
by isiticov
As we've received you order, I guess it works now for you?

Posted: Fri Jun 10, 2005 6:45 pm
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

Posted: Fri Jun 10, 2005 6:49 pm
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

Posted: Sat Jun 11, 2005 5:51 am
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.