?
Solved

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

Posted on 2003-11-06
1
Medium Priority
?
2,074 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 750 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

Industry Leaders: 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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…

770 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