Haven't used D 2006, so don't know all the gotchas, but perhaps the "packed" or "$Align" defaults are different, so record definition is packed in one version of Delphi but aligned in the other?

At 09:32 AM 8/20/2010, wvido...@metsec.com wrote:
Dear All,

I wrote an application using delphi5 which reads and writes  binary file
using TFilestream.  But then when I ported the application to Delphi
2006 the files written using old application returns junk data in the
new version.

Sample file open procedure:



procedure OpenProjectFile;

var FSave:TFileStream;

begin

     //open an existing project file

      FSave:=TFileStream.Create(Open1.FileName,fmOpenReadWrite);

      FSave.Read(MyData,Sizeof(MyData));

      FSave.Free;

end;



MyData is a record which is the same in both sources.

I am at a loss why this is happening. Can anyone throw some light on
this?

Thanks William


This email is intended for the addressee only.

Please see our email policy at http://www.metsec.com/asp/home/edisclaimer.asp
_______________________________________________
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com

_______________________________________________
Delphi mailing list
Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to