Writefile causes crash, with access violation

后端 未结 1 1622
我在风中等你
我在风中等你 2021-01-11 18:46

So basically I wish to write a byte array to a file, however the program crashes. Unhandled exception at 0x7766DEE1 (KernelBase.dll) in append.exe: 0xC0000005: Access viola

相关标签:
1条回答
  • 2021-01-11 18:59

    The argument passed to WriteFile used to store the number of bytes written (at) can only be null if the argument for the overlapped structure is not null. I suggest changing at to be a DWORD and pass a pointer to it.

    DWORD at;
    WriteFile(file, image, fileSize, &at, NULL);
    
    0 讨论(0)
提交回复
热议问题