Solved

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

Posted on 2003-11-06
1
2,046 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
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to deal with "Consider using Code First Migrations to update the database" ? 7 273
ShiftLeft challenge 21 82
Need more details 5 153
Excel file not created as expected 7 72
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared 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…

803 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