1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
/*static*/ UINT CCommSerie::Thread(LPVOID pParam)
{
//
CCommSerie *pCom = (CCommSerie*)pParam;
int nResult;
DWORD WaitEvent = 0;
DWORD dwError=0;
DWORD dwMaskEvent=0;
//POUR ESSAI, A EFFACER
//pCom->m_pParent->SendMessage(WM_CCOMRCV,(WPARAM)pCom,dwMaskEvent);
pCom->m_bThreadExist=true; // amorce l'existance du thread
while(1)
{
nResult=pCom->WaitCommEvent(dwMaskEvent);
if (!nResult)
{
switch(dwError=GetLastError())
{
case 87:
case ERROR_IO_PENDING:
break;
default:
{
// erreur de communication on fait suivre ...
pCom->GetError();
pCom->OnError(dwError);
break;
}
}
}
.......
} |
Partager