Hi BiteRider/Nan

Does the DiskStream object inherit the StrRead from the stream object

I have the following code and it seems runs fine until I get to the StrRead and it crashes - I am trying to read a zero terminated string, I found the StrRead method after I had written my own proc to do it

lea edi, tmpID
OCall .pExerciseFile::DiskStream.BinRead,edi,4
; =============================
DbgDec tmpID, "ID"
; =============================

OCall ebx::lookUp.SetID,tmpID
OCall .pExerciseFile::DiskStream.StrRead
; =============================
DbgDec eax,"Text Ptr"
; =============================

Any help would be appreciated


Posted on 2005-03-15 09:08:19 by taff
Hi Taff
The answer is yes, all Stream derived objects inherit the StrWrite and StrRead methods.
I suspect that you have a problem with the string format stored in the DiskStream. If you have saved it using your own code (not StrWrite) you have to follow the following convention:

+0:? String size NOT including the zero terminating byte (dword).
+4:? String byte data without the zero terminating byte (bytes)!

The easiest way to store strings in the correct format is using StrWrite.


Posted on 2005-03-16 00:36:40 by Biterider
Thanks Biterider

I re-saved the data with the extra info and it now works a treat.

Thanks for the help


Posted on 2005-03-16 03:41:41 by taff