PRB: Form QueryUnload Fires Before the Activate Event (190313)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q190313

SYMPTOMS

Under certain conditions, the QueryUnload event of a form fires before the Activate event. If code in the Activate event of a form takes some time to execute, the QueryUnload event fires before the code in the Activate event.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a form and add the following code to the Activate event of the form:
          ? "Inside the Activate event."
          *DEBUGOUT PROGRAM()
          FOR i = 1 TO 5000
                SET MESSAGE TO ALLTRIM(STR(i))
          NEXT i
  2. Add the following code to the QueryUnload event of the form:
          ? "Inside the QueryUnload event."
          *DEBUGOUT PROGRAM()
          WAIT WINDOW "Inside the QueryUnload Event."
  3. Run the form and click the Command window to remove focus from the form. Now, click the Close control to close the form. Notice that the Activate event fires, then the QueryUnload event fires.
  4. Unremark the two DEBUGOUT commands and remark the WAIT WINDOW command. Open the Debugger and note that in the Output window of the Debugger the QueryUnload event fires after the Activate event.

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbprb KB190313 kbAudDeveloper