When using a CFile, for Some reason my call to read() returns 0 bytes after the first call
CFile iniFile;
int bytesRead=0;
char buffer[_MAX_PATH];
if(iniFile.Open(iniDirFilename,CFile::modeRead)){
bytesRead += iniFile.Read(buffer,_MAX_PATH); // read file path
SaveDirectoryBox->SetWindowTextA(buffer);
iniFile.Seek(bytesRead,CFile::begin); // reposition pointer
int x =iniFile.GetLength();
int y =iniFile.GetPosition();
bytesRead += iniFile.Read(buffer,_MAX_PATH); // read subfile path
subSaveDirectoryBox->SetWindowTextA(buffer);
iniFile.Seek(bytesRead,CFile::begin); // reposition pointer
}
It shows me that the file length is only 72 bytes when I know it is clearly more. I saved a bunch of null terminated strings. For example "Hello" I suspect that upon construction the CFile class looks for the first NULL character and calls it the end of file. I tried using the setLength() function but that gives me an error
How can I read the rest of the file?
edit:
I should mention that I have my project set to read an write in ascii. And the file is written in ascii too