المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Division By Zero Exception



C++ Programming
05-31-2012, 11:10 PM
Hi,

I have a CWinThread::run overidable that is generating a division by zero at a call to IsIdleMessage which I cann't for the life of me figure out why

Any insight is appreciated

int SockCLeintThread::Run()
{ ASSERT_VALID(this);
MSG m_msgCur;
// for tracking the idle time state
if (!flags.is_connected)
return TRUE;
BOOL bIdle = TRUE;
LONG lIdleCount = 0;
// acquire and dispatch messages until a WM_QUIT message is received.
for (;;)
{ phase1: // check to see if we can do idle work
while (bIdle && !::PeekMessage(&m_msgCur, NULL, NULL, NULL, PM_NOREMOVE))
{ // call OnIdle while in bIdle state
if (!OnIdle(lIdleCount++))
bIdle = FALSE; // assume "no idle" state
} // phase2: pump messages while available
do { // pump message, but quit on WM_QUIT
if (!PumpMessage())
return ExitInstance();
// reset "no idle" state after pumping "normal" message
<b>if (IsIdleMessage(&m_msgCur))