VC6.0中调用fwrite时出现0xC0000005:Access Violation错误...跪求高人
我从串口处获得128个byte的数据,然后存入数组(未越界),调用fwrite写入文件.
在debug模式下就会出现0xC0000005:Access Violation错误,调用堆栈有以下信息:
NTDLL! 7c91245f()
NTDLL! 7c926970()
NTDLL! 7c9192a3()
NTDLL! 7c91248d()
_heap_alloc_base(unsigned int 4144) line 161
_heap_alloc_dbg(unsigned int 4096, int 2, const char * 0x005fba80 `string', int 59) line 367 + 9 bytes
_nh_malloc_dbg(unsigned int 4096, int 0, int 2, const char * 0x005fba80 `string', int 59) line 242 + 21 bytes
_malloc_dbg(unsigned int 4096, int 2, const char * 0x005fba80 `string', int 59) line 163 + 27 bytes
_getbuf(_iobuf * 0x00625c08) line 59 + 19 bytes
_flsbuf(int -1, _iobuf * 0x00625c08) line 153 + 9 bytes
_fwrite_lk(const void * 0x0012e880, unsigned int 128, unsigned int 1, _iobuf * 0x00625c08) line 171 + 13 bytes
fwrite(const void * 0x0012e880, unsigned int 128, unsigned int 1, _iobuf * 0x00625c08) line 73 + 21 bytes
CPbDocument::ProcessDpbfFileData(char * 0x00da732c, DFileData * 0x0012e87c, unsigned char * 0x0062cae0 unsigned char * out_buffer, unsigned int * 0x0012e904) line 452 + 28 bytes
CAnwTermDlg::ProcessResponse() line 1685
显示好像就在fwrite(pFileData->FileData,pFileData->Datalength,1,fp)的时候出错,而且单步调试的时候可以通过,求高人解答