DoEvents in VC++/MFC
Posted on 2001-06-05
My problem is the following:
I have a loop that repeats a couple of instruction to generate a sound. I want to be able to stop this loop at one point. To be able to do that, I made a Global Variable (bool Stop). And each time i redo my loop i check it it's true, if it is I quit if not I loop.
In theory it's a good concept except that in practice my application freezes while it's in the loop and i can't seem to press my button that changes Stop (bool var) to true to end my loop.
I know that in VB, the DoEvents function gives you the possibility to do other actions (events ie keypress, mousepress) while in a loop. How do we do that in VC++.
Please provide code or links to ressource pages.
Any suggestions on different approach are welcome