Abort Retrieve

Giganews Newsgroups
Subject: Abort Retrieve
Posted by:  Sümer Cip (sume…@gmail.com)
Date: Tue, 10 Oct 2006

Hi,
I am trying to abort retrieving of a message by raising an exception in the
OnWork event of TIdPOP3.I use Indy 10.I can successfully abort the operation
but the problema arises when I try to retrieve another message with the
component.The retrieve function executes normally without errors but it does
not retrieve any message.The debugger is stuck at this line:

procedure TIdReplyPOP3.RaiseReplyError;
begin
  raise EIdReplyPOP3Error.CreateError(Code, Text.Text);
end;

The text is blank.The OnWork event is like this:

procedure TGenericThread.POP3Progress(ASender: TObject;
  AWorkMode: TWorkMode; AWorkCount: Integer);
begin
  if (fThreadType = ctRetrieve) then
  begin
    fWorkProgress := AWorkCount;
    Synchronize(UpdateGauge);
  end;

  if (fFinished = true) and (fThreadType = ctRetrieve) then
  begin
    fStatusText := DISCONNECTED_TEXT;
    Synchronize(UpdateStatus);
    fWorkProgress := 0;
    Synchronize(UpdateGauge);
    raise Exception.Create('');
  end;

end;

Replies