串口接收数据readfile()函数疑义?

串口接收数据readfile()函数疑问??
bReadStat=ReadFile(hCom, cd_new,wCount,&wCount,NULL);
使用他来接收数据,但是现在的情形是,readfile什么时候返回失败,什么叫接收失败,有没有超时情况,比如我想从COM1接收数据,但是长时间没有数据发来,readfile返回什么,要是又超时,readfile监听com的时间是多少??

------解决方案--------------------
你可以设置超时时间啊
------解决方案--------------------
用SetCommTimeouts设置超时
------解决方案--------------------
引用:
用SetCommTimeouts设置超时



typedef struct _COMMTIMEOUTS { 
 DWORD ReadIntervalTimeout; 
 DWORD ReadTotalTimeoutMultiplier;  
 DWORD ReadTotalTimeoutConstant;   //这个值, 并且会加到上面那个值去
 DWORD WriteTotalTimeoutMultiplier; 
 DWORD WriteTotalTimeoutConstant;
} COMMTIMEOUTS, *LPCOMMTIMEOUTS;

------解决方案--------------------
http://bbs.****.net/topics/360245789