Solved

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

Posted on 2003-11-06
1
2,033 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
1 Comment
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 250 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now