15,471
社区成员
发帖
与我相关
我的任务
分享
UINT CParkingDlg::CheckNVRState(LPVOID pParam)
{
NET_DVR_WORKSTATE_V30 state;
CParkingDlg * pObject =(CParkingDlg*)pParam;
while(1)
{
if(NET_DVR_GetDVRWorkState_V30(pObject->m_lId,&state)==0) //m_lId是设备连接返回的设备ID;
{
pObject->m_nState=pObject->m_nState | NVR_ERROR; //如果连接不正常,系统状态标记改变
}
else
{
pObject->m_nState=pObject->m_nState & ~NVR_ERROR;
}
Sleep(1000);
}
return 0;
}
BOOL AFXAPI AfxInternalPumpMessage()
{
_AFX_THREAD_STATE *pState = AfxGetThreadState();
if (!::GetMessage(&(pState->m_msgCur), NULL, NULL, NULL))
{
#ifdef _DEBUG
TRACE(traceAppMsg, 1, "CWinThread::PumpMessage - Received WM_QUIT.\n");
pState->m_nDisablePumpCount++; // application must die
#endif
// Note: prevents calling message loop things in 'ExitInstance'
// will never be decremented
return FALSE;
}
#ifdef _DEBUG
if (pState->m_nDisablePumpCount != 0)
{
TRACE(traceAppMsg, 0, "Error: CWinThread::PumpMessage called when not permitted.\n");
ASSERT(FALSE);
}
#endif
#ifdef _DEBUG
_AfxTraceMsg(_T("PumpMessage"), &(pState->m_msgCur));
#endif
// process this message
if (pState->m_msgCur.message != WM_KICKIDLE && !AfxPreTranslateMessage(&(pState->m_msgCur)))
{
::TranslateMessage(&(pState->m_msgCur));
::DispatchMessage(&(pState->m_msgCur));
}
return TRUE; //程序停留在这里
}