Discussion:
[fpc-pascal] TStream ReadComponent
Leonardo M. Ramé
2009-03-20 21:56:01 UTC
Permalink
Hi, I'm trying to read a file stream created using TMemoryStream's WriteComponent method with a Delphi 7 program. To read the component I use TMemoryStream's ReadComponent method.

When I read use ReadCompoent, a EReadError is raised. Does anyone tried this?. The same program works perfectly in Delphi.

Leonardo.
Michael Van Canneyt
2009-03-20 23:35:49 UTC
Permalink
Post by Leonardo M. Ramé
Hi, I'm trying to read a file stream created using TMemoryStream's WriteComponent method with a Delphi 7 program. To read the component I use TMemoryStream's ReadComponent method.
When I read use ReadCompoent, a EReadError is raised. Does anyone tried this?. The same program works perfectly in Delphi.
It's not guaranteed that the streams created by Delphi 7 and FPC are binary equivalent.
The best you can do in such a case is to create a text stream in delphi, FPC should be
able to convert and read that.

Michael.

Loading...