<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>I have what I think is a unique issue and hoping someone might 
be able to offer a suggestion.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>PROBLEM:&nbsp; Can't get Do/Loop and Timer/Loop to 
Exit</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>I have a static counter in the PAINT event to set up a trigger 
to call a Do/Loop.</FONT></DIV>
<DIV><FONT size=2>This is done to allow the screen to be painted to a certain 
point and then the loop is designed to finish painting the screen in slow 
motion.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>Once the Do/Loop is entered it is controlled (slow motion) by 
calling&nbsp;the Timer/Loop routine&nbsp;</FONT><FONT size=2>which uses 
SetWaitableTimer and MsgWaitForMultipleObjects to control the speed of painting 
and allow the user interface to still be active.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>Everything works well.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>----- Heres were the problem is:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>If the program is to exited prior to the loop finishing,  the 
user clicks File/Exit.</FONT></DIV>
<DIV><FONT size=2>A global structure variable was included in the loop <U>in an 
attempt </U>to quickly exit both the Do/Loop and the Timer/Loop, but whatever 
reason is never seen by the Loops prior&nbsp;to the call to unload the MDI 
form.&nbsp; The system locks or generates an error.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>Any ideas how to resolve?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>Thanks</FONT></DIV>
<DIV><FONT size=2>David</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>