创建线程
void CMainDlgEx::StartThread()
{
m_EventStop = CreateEvent(NULL,TRUE,FALSE,NULL);
m_EventDealImage...= CreateEvent(NULL,FALSE,FALSE,NULL);
m_EventImageShow = CreateEvent(NULL,FALSE,FALSE,NULL);
m_EventAllowReceiveImage...= CreateEvent(NULL,FALSE,TRUE,NULL);
// auxiliary methods
ResetEvent(m_EventStop);
SetEvent(m_EventAllowReceiveImage