Try to read a binary file.
OpenFile with VAL_BINARY. file handle returned is NOT -1 (is 3).
ReadFile returns 4, but the string is empty.
iFileHandle = OpenFile(szPath, VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_BINARY);
if (iFileHandle < 0)
err = ERROR_FILE_NOT_FOUND;
SetFilePtr(iFileHandle, 0, 0);
nSize = ReadFile(iFileHandle, szSize, 4);
Wher nSize is 4, but szSize is empty.
StringLength is 0
The first byte is NULL. That might be the problem.
How do I get around this ?
TIA.