VC++6 Writefile return 0 bytes written in Windows 7
Hi,
Part of the codes in my application use Writefile to write to a disk partition. It works in XP but not in Windows 7. The value of TempPos is zero after written. What is wrong? Will there be file access rights problem? Thanks
Re: VC++6 Writefile return 0 bytes written in Windows 7
Originally Posted by KevinA
Hi,
Part of the codes in my application use Writefile to write to a disk partition. It works in XP but not in Windows 7. The value of TempPos is zero after written. What is wrong? Will there be file access rights problem? Thanks
Your mistake is assuming that all your calls will be successful without checking them.
Where is your check for SetFilePointer() and WriteFile() return codes? In addition, did you call GetLastError()?
Pay attention to "Return Value" in the links below.
Bookmarks