[Gambas-bugtracker] Bug #1699: Pointers are not written to memory streams correctly when set to null

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Wed Dec 18 08:12:19 CET 2019


http://gambaswiki.org/bugtracker/edit?object=BUG.1699&from=L21haW4-

Comment #8 by Benoît MINISINI:

Do something like that:

hFile = Open Null For Write
hFile.NullTerminatedString = TRUE
MySerialize(hFile)
iLen = Seek(hFile)
Close #hFile

MyPointer = Alloc(iLen)
hFile = Open Memory MyPointer For Write
' you can set NullTerminatedString to FALSE in the memory stream instead of setting it to TRUE in the null stream.
' hFile.NullTerminatedString = FALSE
MySerialize(hFile)
Close #hFile




More information about the Bugtracker mailing list