June 1st, 1999, 07:24 AM
I am using the OnIdle function following the Help instructions. I use the override version in my App class like this:
BOOL CMyApp::OnIdle(LONG lCount)
{
if(CWinApp::OnIdle(lCount))
return TRUE;
if(!m_bReceptionOK ) {
if(GetTickCount() - m_dwInitOp > COMMTMOUT) {
TRACE("Timeout occured\n");
return FALSE;
}
return TRUE;
}
return FALSE;
}
I use this function to see if a timeout occured in a serial communication. But the verification is only executed when there are messages in the application queue, like mouse messages. If a put a TRACE after the CwinApp::OnIdle call I note that lCount is always 1.
If a timeout occurs the TRACE is executed only when I move the mouse, for example. What am I doing wrong? The problem is the GetTickCount() function?
Please help me soon.
Thanks,
Celso Aquino
BOOL CMyApp::OnIdle(LONG lCount)
{
if(CWinApp::OnIdle(lCount))
return TRUE;
if(!m_bReceptionOK ) {
if(GetTickCount() - m_dwInitOp > COMMTMOUT) {
TRACE("Timeout occured\n");
return FALSE;
}
return TRUE;
}
return FALSE;
}
I use this function to see if a timeout occured in a serial communication. But the verification is only executed when there are messages in the application queue, like mouse messages. If a put a TRACE after the CwinApp::OnIdle call I note that lCount is always 1.
If a timeout occurs the TRACE is executed only when I move the mouse, for example. What am I doing wrong? The problem is the GetTickCount() function?
Please help me soon.
Thanks,
Celso Aquino