Solved

Is there an equivalent in MFC of DoEvents in VB, doEvents in Java

Posted on 2003-11-06
1
2,059 Views
Last Modified: 2013-11-25
We need to know what is the MFC Visual C++ equivalent of DoEvents() in Visual Basic or doEvents in Java.

The use of CEvent seems to be quite a heavy solution, just for allowing from time to time the operating system to get hand for executing other tasks.

Thanks for kind reply.
0
Comment
Question by:rgimilio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 250 total points
ID: 9699601
This will do

int DoEvents()
{
      MSG msg;
      int nCount = 0;

      while ( ::PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE) )
      {
            nCount++;
            ::TranslateMessage(&msg);
            ::DispatchMessage(&msg);
      }

      return nCount;
}

Good LUck
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
My project did see openJDK that I installed. What could be the problem 7 161
Problem to open text file 11 136
Capture logon name 13 105
Input parameteres to DragOver 2 37
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question