|
|
|
[求助]vc6.0 定时器制作
我不太懂大侠的意思,请问能详细些码。 |
|
[求助]vc6.0 定时器制作
确实如楼上所说,我的程序不会出现楼上大侠所说的情况,但小弟还想问一下,如果出现那样的问题的话,要怎么解决呢,还望大侠赐教。 |
|
[求助]vc6.0 定时器制作
谢谢楼上的解答,让小弟茅塞顿开,还有一点想问下,如果用第二种方法我添加了很多时间就要开很多线程,那样感觉有点麻烦。 |
|
[求助]如何写模拟键盘鼠标的驱动
帮帮忙啊各位大侠。 |
|
[求助]为什么挂了十个小时才增两点kx
给个建议,最好能最小化到托盘。 |
|
[原创]哈哈····我的Kx也终于够100了!
我要等到什么时候才能升级成为正式会员啊。 |
|
[求助]mfc程序开机启动报错
大哥,他就是报错说要我发送错误报告,你要我怎么跟你说啊 我就想问一下看你们有这方面的经验的前辈,指教下,到底是那块有问题 而且在我的电脑上有没问题 在别的没有vc编译器的电脑上就会出现这样的粗错 |
|
|
|
|
|
[求助]串口程序,dbug版本没问题,release版本出现问题
非常感谢大家的关注,问题还是没有解决 我把接收函数里面的 os相关定义和创建去掉 又把WaitCommEvent(m_HCom,&dwCommStatus,&os);中os换成m_ReadOverLapped不报错,但接收不到数据了。 |
|
|
|
[求助]串口程序,dbug版本没问题,release版本出现问题
我把接收代码注释掉,就不报错,我感觉是我的接收和发送代码有问题,麻烦大家帮小弟看一下 //发送 void C_ControlMatrix::SendData(BYTE data) { DWORD dwError; DWORD dwRealSend = 0; //WaitForSingleObject(m_HMutex,INFINITE); if (ClearCommError(m_HCom,&dwError,NULL)) { PurgeComm(m_HCom,PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR); //清干净输入、输出缓冲区 } if (!WriteFile(m_HCom,(VOID*)&data,1,&dwRealSend,&m_WriteOverlapped)) { if (GetLastError() == ERROR_IO_PENDING) { while (!GetOverlappedResult(m_HCom,&m_WriteOverlapped,&dwRealSend,FALSE)) { if (GetLastError() == ERROR_IO_INCOMPLETE) { //cout<<"写未完成,继续!"< continue; } else { //cout<<"发生错误,尝试恢复!"< ClearCommError(m_HCom,&dwError,NULL); break; } } } } //ReleaseMutex(m_HMutex); } //接收 int C_ControlMatrix::RecveData(char* pReadBuf) { OVERLAPPED os; DWORD dwError; DWORD dwErrorFlags; DWORD dwCommStatus=0; DWORD dwWantRead = CHANNELCOUNT_16; DWORD dwRealRead = 0; memset(&os,0,sizeof(OVERLAPPED)); os.hEvent=CreateEvent(NULL,TRUE,FALSE,NULL); if (os.hEvent==NULL) { return -1; } //WaitForSingleObject(m_HMutex,INFINITE); if(m_HCom!=NULL) { SetCommMask(m_HCom,EV_RXCHAR|EV_TXEMPTY);//有哪些串口事件需要监视 WaitCommEvent(m_HCom,&dwCommStatus,&os); //检测返回的dwCommStatus,了解发生了什么串口事件 if ((dwCommStatus & EV_RXCHAR)==EV_RXCHAR)//缓冲区中有数据到达 { COMSTAT ComStat; DWORD dwLength=0; ClearCommError(m_HCom,&dwErrorFlags,&ComStat); dwLength=ComStat.cbInQue; //输入缓冲区有多少数据 if (dwLength>0) { BOOL fReadStat; fReadStat=ReadFile(m_HCom,pReadBuf,dwWantRead,&dwRealRead,&m_ReadOverLapped); pReadBuf[dwRealRead]='\0'; if (!fReadStat) { if (GetLastError()==ERROR_IO_PENDING) { while(!GetOverlappedResult(m_HCom,&m_ReadOverLapped,&dwRealRead,TRUE)) { dwError = GetLastError(); if (dwError==ERROR_IO_INCOMPLETE) { continue; } } } } } //ReleaseMutex(m_HMutex); CloseHandle(os.hEvent); return dwRealRead; } } //ReleaseMutex(m_HMutex); CloseHandle(os.hEvent); return 0; } |
|
[求助]串口程序,dbug版本没问题,release版本出现问题
麻烦楼上能说的详细些吗,我不太懂。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值