Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5340

ReadFile return empty string

$
0
0

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.

 

 


Viewing all articles
Browse latest Browse all 5340

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>