program project1; {$mode delphi}
uses cmem, Classes, SysUtils; var VBuffer: TBytes; VStream: TStream; begin VStream := TBytesStream.Create; try VBuffer := TEncoding.UTF8.GetBytes('abc'); VStream.WriteBuffer(VBuffer[0], Length(VBuffer)); finally VStream.Free; end; writeln('Press any key to finish...'); readln; end. I tried this with CT540 - it is OK CT570 with newer compiler gets access violation when in debug. If you try application from command prompt then it is OK. Picture attached <http://free-pascal-general.1045716.n5.nabble.com/file/n5724518/AccessViolationCmem.png> -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/CMem-issue-tp5724477p5724518.html Sent from the Free Pascal - General mailing list archive at Nabble.com. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal