Specifications
Appendix B
Implementation in Monitor Thread
B-4
P1028248-001 Rev. A KR203 Software Integrator Guide 8/6/2010
Implementation in Monitor Thread
1. Fill Event Arrays
In the monitoring thread, create and fill an array of handles with the error and status
event handle.
myHandle[0] = pInfo->hError;
myHandle[1] = pInfo->hStatus;
2. Start the Waiting Loop
Start the waiting loop.
UINT StatusThreadProc( LPVOID pParam)
{
CStatusThreadInfo* pInfo = (CStatusThreadInfo*)pParam;
longdwResult=0;
longdwRet=0;
TCHARstr[50]={0};
HANDLEmyHandle[2]={NULL};
DWORDdType=0;
DWORDdNeeded=0;
DWORDdwPgCnt=0;
DWORDdwCutCnt=0;
if (pInfo == NULL)
{
OutputDebugString(L"### entering Status Poll thread
Failed!\n");
return 1; // if pObject is not valid
}
myHandle[0] = pInfo->hError;
myHandle[1] = pInfo->hStatus;
HWND hWnd = GetDlgItem((HWND)pInfo->myHwnd,
IDC_STATUS);
//HWND hWnd = pInfo->myHwnd;
OutputDebugString(L"### entering Status Poll
thread...\n");
SendMessage(hWnd, WM_SETTEXT, 0, (LPARAM)(L"###
entering Status Poll thread..."));