[fpc-pascal] TStream ReadComponent

Michael Van Canneyt michael at freepascal.org
Sat Mar 21 00:35:49 CET 2009



On Fri, 20 Mar 2009, Leonardo M. Ramé wrote:

> 
> 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.


More information about the fpc-pascal mailing list