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 38 39 40 41
|
DWORD WINAPI Thread_2(LPVOID lpParam)
{
.
hEvent[0] = hStopEventReadPoint;
hEvent[1] = hStartEventReadPoint;
while(1)
{
iCode = WaitForMultipleObjects(2,hEvent,FALSE, INFINITE);
if(iCode == WAIT_OBJECT_0)
{
ResetEvent(hStopEventReadPoint);
break;
}
else
{
.....
//traitement
m_StaticMessageDef.SetWindowText(str); //CStatic m_StaticMessageDef; <-------- ca bloque ici
}
}
}
void DialogData::OnDestroy()
{
/* ==== Fermerture de thread d'acquisition des flux ==== */
if (hStopEventReadPoint)
{
SetEvent(hStopEventReadPoint);
WaitForMultipleObjects(1, &hThread_ReadLastPointOfMAGChannel, TRUE, INFINITE);
}
CDialog::OnDestroy();
} |