DCB.StopBits=ONESTOPBIT, 0
而不是1,ONESSTOPBITS,1.5 stop bits.
2,TWOSTOPBITS.
<hr>
hch_Write.hEvent=CreateEvent(NULL,TRUE,FALSE,NULL);
if(!WriteFile(comhandle, outbuff, 1024, &towrite, &hch_Write))
{
//HCH_TEST;
if(GetLastError()==ERROR_IO_PENDING)
//GetLastError()函数返回ERROR_IO_PENDING,表明串口正在进行读写操作
{
//INFINITE
WaitForSingleObject(hch_Write.hEvent, 5000);
//使用WaitForSingleObject函数等待,直到写操作完成或延时已达到5秒钟
PurgeComm(comhandle, PURGE_TXABORT|PURGE_TXCLEAR);