Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: while loop in threads Pin
Aamir Butt28-Sep-04 1:25
Aamir Butt28-Sep-04 1:25 
GeneralRe: while loop in threads Pin
Blake Miller28-Sep-04 4:30
Blake Miller28-Sep-04 4:30 
GeneralRe: while loop in threads Pin
ledallam28-Sep-04 18:10
ledallam28-Sep-04 18:10 
GeneralRe: while loop in threads Pin
David Crow28-Sep-04 4:05
David Crow28-Sep-04 4:05 
GeneralRe: while loop in threads Pin
Andrzej Markowski28-Sep-04 8:10
Andrzej Markowski28-Sep-04 8:10 
GeneralRe: while loop in threads Pin
ledallam28-Sep-04 18:11
ledallam28-Sep-04 18:11 
GeneralRe: while loop in threads Pin
Andrzej Markowski28-Sep-04 19:38
Andrzej Markowski28-Sep-04 19:38 
GeneralRe: while loop in threads Pin
ledallam28-Sep-04 19:48
ledallam28-Sep-04 19:48 
After modifying the code like this,
DWORD dwLastTickCount = ::GetTickCount();
DWORD dwWaitResult = WaitForSingleObject(m_MonitorEvent, INFINITE);
TRACE("dwWaitResult(%d)",dwWaitResult);
// print return value from WaitForSingleObject
switch (dwWaitResult)
{
case WAIT_OBJECT_0://Do the work
ResetEvent(m_MonitorEvent);
break;
default
break;
}
TRACE("Time of the job in ms: %d\n",::GetTickCount()-dwLastTickCount);
dwLastTickCount = ::GetTickCount();

my debug output is
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 16
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 15
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 16
dwWaitResult(0)Time of the job in ms: 16
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 15
dwWaitResult(0)Time of the job in ms: 16
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 16
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 15
dwWaitResult(0)Time of the job in ms: 16
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 15
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 16
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 16
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 15
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 16
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 15
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 0
dwWaitResult(0)Time of the job in ms: 15
GeneralRe: while loop in threads Pin
Andrzej Markowski28-Sep-04 20:09
Andrzej Markowski28-Sep-04 20:09 
GeneralRe: while loop in threads Pin
ledallam28-Sep-04 20:30
ledallam28-Sep-04 20:30 
GeneralRe: while loop in threads Pin
Andrzej Markowski28-Sep-04 20:50
Andrzej Markowski28-Sep-04 20:50 
GeneralRe: while loop in threads Pin
ledallam28-Sep-04 21:17
ledallam28-Sep-04 21:17 
GeneralRe: while loop in threads Pin
Andrzej Markowski28-Sep-04 21:32
Andrzej Markowski28-Sep-04 21:32 
GeneralRe: while loop in threads Pin
ledallam28-Sep-04 21:39
ledallam28-Sep-04 21:39 
GeneralRe: while loop in threads Pin
Blake Miller29-Sep-04 4:22
Blake Miller29-Sep-04 4:22 
GeneralCalling vb .net dll in a C++ console app Pin
Tumisang28-Sep-04 0:26
Tumisang28-Sep-04 0:26 
GeneralRe: Calling vb .net dll in a C++ console app Pin
BAIJUMAX28-Sep-04 1:45
professionalBAIJUMAX28-Sep-04 1:45 
GeneralCFile::Read() : Giving zero bytes read Pin
Ardhendu_diva28-Sep-04 0:09
Ardhendu_diva28-Sep-04 0:09 
GeneralRe: CFile::Read() : Giving zero bytes read Pin
22491728-Sep-04 1:03
22491728-Sep-04 1:03 
GeneralRe: CFile::Read() : Giving zero bytes read Pin
ardhendu12328-Sep-04 1:46
ardhendu12328-Sep-04 1:46 
GeneralRe: CFile::Read() : Giving zero bytes read Pin
22491728-Sep-04 17:23
22491728-Sep-04 17:23 
GeneralRe: CFile::Read() : Giving zero bytes read Pin
Antony M Kancidrowski28-Sep-04 1:50
Antony M Kancidrowski28-Sep-04 1:50 
GeneralRe: CFile::Read() : Giving zero bytes read Pin
ardhendu12328-Sep-04 1:57
ardhendu12328-Sep-04 1:57 
GeneralRe: CFile::Read() : Giving zero bytes read Pin
Antony M Kancidrowski28-Sep-04 2:22
Antony M Kancidrowski28-Sep-04 2:22 
GeneralRe: CFile::Read() : Giving zero bytes read Pin
vcplusplus28-Sep-04 4:07
vcplusplus28-Sep-04 4:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.