BeginWork exception

Giganews Newsgroups
Subject: BeginWork exception
Posted by:  Tim (tim.f…@orcus.co.uk)
Date: Fri, 11 Jan 2008

Hi All

Have a bit of a problem with the Indy FTP Client when I assign a beforework
event but I'm not sure its limited to just this event.

I wront a very simple app to demonstrate

procedure TForm1.IdFTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode;
  AWorkCountMax: Int64);
begin
showmessage('test');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
IdFTP1.Host := 'ftp.host;
IdFTP1.Username := 'username';
IdFTP1.Password := 'password';
IdFTP1.Connect;
IdFTP1.ChangeDir('public/');
IdFTP1.List;
showmessage(IdFTP1.ListResult.Text);
end;

After you click ok on the "test" message box you get an eprivilage
instruction error at the very end of

procedure TIdComponent.BeginWork(AWorkMode: TWorkMode; const ASize: Integer
= 0);
begin
  if FWorkTarget <> nil then begin
    FWorkTarget.BeginWork(AWorkMode, ASize);
  end else begin
    Inc(FWorkInfos[AWorkMode].Level);
    if FWorkInfos[AWorkMode].Level = 1 then begin
      FWorkInfos[AWorkMode].Max := ASize;
      FWorkInfos[AWorkMode].Current := 0;
      if Assigned(OnWorkBegin) then begin
        OnWorkBegin(Self, AWorkMode, ASize);
      end;
    end;
  end;
end; // exception raised here

I'm using Delphi 7 and quite an old version of Indy 10

I've tried to upgrade to the latest version of indy but it wouldn't compile
as there were files missing from the the system directory including IdSys
and IdSysVCL. I did try to copy the old file versions in but that didn't
work.

Can anyone help please?

Thanks

Tim

Replies