Closing while in DoEvents causes exception
Posted on 1998-10-29
I'm a VC programmer that used VB to create a control to embed in my MFC MDI Application. I am getting an unhandled exception when I close my MFC application while my VB control is in a paint loop. I have a DoEvents in the loop, which, if I remove, prevents the exception from occuring but then I can't process other messages.
My question is: Is there some way to do the equivalent of an ::AfxLockApp() in VB? I think the rug is getting pulled out from underneath my control while it's in this paint loop. I just want to lock things down while it's in this paint loop so it can't go away until it finishes.
Thanks in advance