15,471
社区成员
发帖
与我相关
我的任务
分享
UINT WINAPI MyCom::ListenThread(void *lParam)
{
MyCom *pMyCom = reinterpret_cast<MyCom*>(lParam);
while(!pMyCom->m_Thread_Flag)
{
UINT numbit = pMyCom->GetComByte();
if (numbit == 0)
{
Sleep(SLEEP_TIME);
continue;
}
char cData = '\0';
do
{
cData = '\0';
if (pMyCom->read(cData) == TRUE)
{
std::cout << cData;
continue;
}
}while(--numbit);
}
return 0;
}