title: MFC do while loop
body: <p>I am doing a measurement system and I have got a do while loop in my program. In the loop, it is checking if any motor is moving before it could take measurement as it require it to reach the target position before doing anything.</p>
  
  <p>While doing the measurement, it is suppose to tell me how long does it took to do this measurement.</p>
  
  <p>However, whenever it runs in the do while loop, all my timer function stop as if they are put to Sleep mode.</p>
  
  <p>Is there any other method where I could implement this? If there is, please help me. </p>
  
  <p>Any help would be much appreciated.</p>
  
  <pre><code>SetTimer(TIMERECHO, 1000, NULL);
  
  BOOL bMoving = FALSE;
  do
  {
      if (IsMoving(ID, NULL, &amp;bMoving)) 
          GetPosition();
  } while (bMoving);
  
  
  void CLHMDlg::OnTimer(UINT_PTR nIDEvent)
  {
      // TODO: Add your message handler code here and/or call default
      switch(nIDEvent)
      {
          case TIMERECHO:
              UpdateData(FALSE);
              m_Seconds++;
              m_TimerEcho.Format(_T("Total time: %ds"), m_Seconds);
              break;
      }
      CDialogEx::OnTimer(nIDEvent);
  }
  </code></pre>