|
evc的线程跟VC处理不一样的.
//申明
static DWORD WINAPI ThreadTest01(PVOID pParam);
HANDLE m_hThreadTest01;
HANDLE m_hEventTest01;
//初始化
m_hEventTest01 = CreateEvent(NULL,FALSE,FALSE,NULL);
::ResetEvent(m_hEventTest01);
if (!GetExitCodeThread(m_hThreadTest01,&dwState) || (dwState != STILL_ACTIVE))
{
m_hThreadTest01 = CreateThread(NULL,0,ThreadTest01,this,0,&dwState);
}
//处理
DWORD WINAPI COrbitRecorderDlg::ThreadTest01(PVOID pParam)
{
COrbitRecorderDlg *pDlg = (COrbitRecorderDlg *)pParam;
while (pDlg->m_hEventTest01 != INVALID_HANDLE_VALUE)
{
static USHORT usData = 0;
DWORD nResult = WaitForSingleObject(pDlg->m_hEventTest01,INFINITE);
if (nResult == WAIT_OBJECT_0) //有东西触发
{
//处理
}
return 0;
}
//触发现成
SetEvent(m_hEventTest01); |
|