K
Kriss
Unregistered / Unconfirmed
GUEST, unregistred user!
我写了以下几行代码:<br>var srcFileHandle:integer;nFileSize:integer;<br> bufChar;nReadCount:integer;<br>begin<br> srcFileHandle:=FileOpen('e:/download/wmp7s.exe',fmOpenRead);<br> nFileSize:=FileSeek(srcFileHandle,0,2);<br> FileSeek(srcFileHandle,0,0); //回到文件开头<br> buf:=PChar(AllocMem(nFileSize));<br> nReadCount:=FileRead(srcFileHandle,buf,nFileSize);<br>经过我的调试,我发现FileOpen,FileSeek函数都工作正常,但是在FileRead函数中,它的<br>返回值总是-1,就是出错,为什么,我百思不得其解,求教各位了!