Click to See Complete Forum and Search --> : Problem in Serial API


RahulKateWin32
July 23rd, 2005, 04:34 AM
Hi All,
I have one porblem regarding WaitCommEvent() function.I written one program which is serially connected to modem and waiting for carrier detect event after dialing to modem using "ATDT3453" command.
Problem--> At the first time WaitCommEvent() function return after the carrier detect over modem.But at the second time in continously running program when I again dialing to modem and waiting for Carrier detect event using function WaitCommEvent(),so the problem is at the second time it will return before the detection of event(RLSD or Carrier Detect)

I am originally coding like this,

DWORD dwCommEvent;
SetCommMask(m_nCommPortHandle,EV_RLSD);
while(1)
{
WaitCommEvent(m_nCommPortHandle, &dwCommEvent, NULL);
if(dwCommEvent==EV_RLSD)
{
FlushFileBuffers(m_nCommPortHandle);
break;
}
}
return TRUE;

Rahul
Pune(INDIA)