I've problem reading a binary file, however it's successful in reading non-binary files such as text/wri files.
Specifically, the buffer reads NULL bytes and gives me ASSERT(lpBuf != NULL) from filecore.cpp, line 243. But, why is this just happening for binary files and not for the non-binary ones? I've tried the c runtime function fread() and it fails on the 2nd attempt of the loop yielding some 9 odd bytes of read bytes even when reading large files (400kb).
This is the code:
CFile pFile (sFilename, CFile::modeRead);
int iReadSize = 0;
iReadSize = pFile.Read(pBuf, 4096);
if(iReadSize == 0)
//my processing goes here
Any suggestions please?