idMessage SaveToStream

Giganews Newsgroups
Subject: idMessage SaveToStream
Posted by:  John Mackerras (indy…@desmac.com.au)
Date: Mon, 6 Oct 2003

Indy Version 9.0.14

Can anyone tell me what is wrong with this code? I can't see it.  The
variable Y causes an access violation.

procedure TForm1.Button2Click(Sender: TObject);
var
  vStream : TMemoryStream;
  y : integer;
begin
  vStream := TMemoryStream.Create;
  try
    idMessage1.SaveToStream(vStream, false);
    y := vStream.Size;
  finally
    vStream.Free;
  end;
end;

Replies