UINT __cdecl ReadMIMUThread(LPVOID pParam)//生产模式
{
CPC_MonitorDlg * pDlg ;
pDlg = (CPC_MonitorDlg *)pParam;
CTime ct=CTime::GetCurrentTime();
QueryPerformanceFrequency(&nFreq);
FreFlag = nFreq.QuadPart;
while(pDlg->m_bMonitorread)//监测器读取数据标志位有效
{
wCount = 0; //读取的字节数
Sleep(5);
wCount = pDlg->m_Serial.ReadData(strRes, 24000, m_siByte);
fopen(pDlg->m_strFileName2,"w+");
fseek(pDlg->fpZL,0,SEEK_END);
LenZL=ftell(pDlg->fpZL);
fwrite(&strRes,sizeof(strRes),sizeof(strRes),pDlg->fpZL);
fclose(pDlg->fpZL);
程序编译链接没报错,运行后调用线程,出现调试中断错误,在wincore.cpp 991
不知道是不是线程中不能那样对文件进行读写