Wednesday, March 14, 2012 12:42 AM
I have created a thread which does polling to a service at regular intervals. To introduce the delay between successive polls, I am trying to use the above methods.
// Create an event that will never happen.
m_event= CreateEventEx(0, FALSE, FALSE, 0);
CoWaitForMultipleHandles(COWAIT_WAITALL, 60*1000, 1, &m_event, &dwsignalled);
But this does not seem to block the thread.
I also tried DWORD wait = WaitForSingleObjectEx(m_event, MAX_WAIT_DELAY_MS, false);
That does not work either.
- Edited by amshinde Wednesday, March 14, 2012 12:42 AM
Thursday, March 15, 2012 10:11 PMModerator
Try this to get the WaitForSingleObjectEx call to work as desired:
HANDLE m_event; m_event= CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS); WaitForSingleObjectEx(m_event, 60000, false);
Friday, March 16, 2012 12:12 AMYa. I did go with the the CreateTimer function. Thanks!