Get trouble while using TFileStream.
Posted on 2001-09-08
here is a piece of my program for save information to file.
void object::WriteToFile(TFileSream *pFile)
Statement 3,4 are for debuging consistent between content of buffer before storing and those after storing.
function WriteToFile are called by handler FileSaveExecute() of a menu item.a TFileStream object is created inside FileSaveExecute() useing new,and delete before return from FileSaveExecute().But the resulting file after called FileSaveExecute() is incorrently(not consistent),
while consistent is got in the debuging.Buffer,Buffer....(Num>0)are always 0 in the resulting file except for Buffer which is stored corrently.what wrong with my program?
i plan to use CArchive which is a MFC class instead of TFileStream.Does C++Builder mind?
the version of C++builder is 5.0