Problems Using OnWorkBegin, OnWork To Generate Progress Bar

Giganews Newsgroups
Subject: Problems Using OnWorkBegin, OnWork To Generate Progress Bar
Posted by:  Frank Bishop (franc…@taconic.net)
Date: Sat, 8 Sep 2007

When Requesting Groups Or Headers I dont Get A Starting Value For On Work
Begin

Sample Output
--------------------------------------

GET GROUPS REQUESTED

News Work Begin Message
0

News NNTPWork Message
16

News NNTPWork Message
40
..
..
..

News NNTPWork Message
782

News NNTPWork Message
785

News WorkEnd Message

Sample Code Used
-----------------------------------------

{******************************************************************************}

procedure TForm1.IdNNTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode;
  AWorkCountMax: Int64);
begin
  memo1.Lines.add('');
  memo1.Lines.add('News Work Begin Message');
  ProgressBar1.Max := AWorkCountMax;
  memo1.Lines.add(inttostr(AWorkCountMax));
  ProgressBar1.Position := 0;
end;

{******************************************************************************}

procedure TForm1.IdNNTP1Work(ASender: TObject; AWorkMode: TWorkMode;
  AWorkCount: Int64);
begin
  memo1.Lines.add('');
  memo1.Lines.add('News NNTPWork Message');
  ProgressBar1.Position := AWorkCount;
  memo1.Lines.add(inttostr(AWorkCount));
end;

{******************************************************************************}

Should Work Begin Output The Max to be used to define ProgressBar1.Max

For Both Groups And Headers I'm always getting zero

Using Indy 10  Version 10.2.3

With Delphi 6 and BDS 2006

Thanks,

Frank Bishop

Replies