Page 1 of 1

Error on Windows 7 64-bit Tablet Edition

Posted: Tue Aug 30, 2011 4:28 am
by moosoft
This only seems to be happening on a Windows 7 Tablet PC. Is there something special about the platform that I need to address?

The error:

Code: Select all

exception number  : 4
exception class   : EOleException
exception message : (55,4):EndBoundary:.
The code:

Code: Select all

procedure tfintegra.addschedule;
var
  TriggerDetails: TTriggerDetails;
  ST: TSystemTime;
  task: ttaskitem;
  saved: boolean;
begin
  scheduler.Open;
  scheduler.Refresh;
  try
    task:=Scheduler.CreateNewItem('Integra System Verify Report');
    with task do
    begin
      // 2 lines optional necessary for Windows VISTA
      CurrentAction := 1;
      InsertAction(VISTA_TASK_ACTION_EXEC);

      creator:='MooSoft Scheduler';

      ApplicationName := extractfilepath(paramstr(0))+'integra.exe';
      Parameters := '/verify';

      comment:='Creates a System Verify Report';

      Triggers.Add(ttDaily);
      DateTimeToSystemTime(Now, ST);
      ST.wHour := 4;
      ST.wMinute := 0;
      ST.wSecond := 0;
      ST.wMilliseconds := 0;
      Triggers[0].StartTime := SystemTimeToDateTime(ST);
      Triggers[0].BeginDate := Date;
      Triggers[0].EndDate := Date + 30; // will be executed during 1 month
      Triggers[0].HasEndDate := false;
      TriggerDetails.Daily.DaysInterval := 1;

      Triggers[0].Details := TriggerDetails;
      Triggers.UpdateTriggers;
      if (not Scheduler.RunningVistaOrLater) then
        Flags := Flags + [tfRunOnlyIfLoggedOn];
      SetAccountInformation(GetOSUser, '');
      if Scheduler.RunningVistaOrLater and IsUserAnAdmin then
        TaskDefinition.Principal.RunLevel := TASK_RUNLEVEL_HIGHEST;

      saved:=true;
      try
        Save;  //<-- error here
      except
        on e: exception do
          begin
            saved:=false;
            addlog('Add Task', e.Message);
            taskdlg.Title:='Add Task';
            taskdlg.Instruction:='The task could not be saved due to an error.';
            taskdlg.Content:=e.Message;
            taskdlg.CommonButtons:=[cbok];
            taskdlg.Icon:=tierror;
            taskdlg.Execute;
          end;
      end;
    end;

    if saved then
      begin
        propertiesdlg(task);

        schedulesnapshot1.Enabled:=false;
        removescheduledsnapshot1.enabled:=true;
        editscheduledsnapshot1.Enabled:=true;

        taskdlg.Title:='Add Task';
        taskdlg.Instruction:='The task has been added.';
        taskdlg.CommonButtons:=[cbok];
        taskdlg.Icon:=tiinformation;
        taskdlg.Execute;
      end;
  except
    taskdlg.Title:='Add Task';
    taskdlg.Instruction:='The task could not be added at this time.  Please try again later.';
    taskdlg.CommonButtons:=[cbok];
    taskdlg.Icon:=tierror;
    taskdlg.Execute;
  end;
  scheduler.Close;
end;

Posted: Tue Aug 30, 2011 5:53 am
by isiticov
Do you use the latest version available from our web site?

Posted: Tue Aug 30, 2011 7:34 am
by moosoft
Ah no, I have 2.0.3

I should have remembered to check that. I have had to send an email to support asking for my login info as it has been so long since I used it.

I will let you know what happens!

Posted: Wed Aug 31, 2011 7:17 am
by moosoft
Ok, I got the 2.0.6 update but now when I compile I get:
[DCC Fatal Error] integrau.pas(16): F2051 Unit saTask was compiled with a different version of MSTask.ITaskTrigger

Any idea how to fix that?

Posted: Wed Aug 31, 2011 7:31 am
by isiticov
The reason for this could be an existing installation of JEDI library, which includes MsTask unit too. Just adjust your project library path settings to include the Scheduling Agent sources' path before the JEDI's.

Posted: Wed Aug 31, 2011 7:35 am
by moosoft
Ok, fixed it. The installer (I guess) set the path to:

C:\Program Files (x86)\SiComponents\Scheduling Agent\Source\CRS2009

and changing it to

C:\Program Files (x86)\SiComponents\Scheduling Agent\Source

fixed it.

Posted: Wed Aug 31, 2011 8:13 am
by moosoft
It seems to be working so far. Haven't been able to test on the Win7 Tablet Edition yet.

On a side note, there is a typo in props.pas->PageControl->Settings->PanelVistaSettings->ListVistaFlags

There is "hiden" and should be "hidden"

I love this component. You have saved me so much work :)

Posted: Thu Sep 01, 2011 3:10 am
by isiticov
Thank you for reproting this. We will fix this.