关于串口的问题(使用mscomm控件)
控件的触发函数如下:
nEvent = m_Com.GetCommEvent();
switch(nEvent)
{
case 2:
k = m_Com.GetInBufferCount();
if(k > 0)
{
vResponse=m_Com.GetInput(); //read
str = (char*)(unsigned char*) vResponse.parray->pvData;
}
m_strReceive = (const char *)str;
break;
case 3:
break;
}
为什么会丢失数据,每次发送300字节,只能接收到一部分数据
nEvent = m_Com.GetCommEvent();
switch(nEvent)
{
case 2:
k = m_Com.GetInBufferCount();
if(k > 0)
{
vResponse=m_Com.GetInput(); //read
str = (char*)(unsigned char*) vResponse.parray->pvData;
}
m_strReceive = (const char *)str;
break;
case 3:
break;
}
为什么会丢失数据,每次发送300字节,只能接收到一部分数据
...全文


