FIX: GP Fault or UAE When Unload Form in DragOver Event

Last reviewed: October 30, 1997
Article ID: Q93233
2.00 WINDOWS kbprg kbbuglist

The information in this article applies to:

- Microsoft Visual Basic programming system for Windows, version 2.0

SYMPTOMS

If you place an Unload statement in the DragOver event procedure, a general protection (GP) fault or Unrecoverable Application Error (UAE) occurs depending on which version of Windows you are using.

WORKAROUND

Do not place an Unload statement in a DragOver event procedure, or use code to check to make sure that you are done dragging before trying to unload a form. For example, you might use a Timer control. Enable the timer in the DragOver event procedure by setting it to True. Then place the Unload statement in the Timer1_Timer event procedure, and disable the timer by setting the Enabled property to False in the Unload event procedure.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Visual Basic programming system for Windows, version 2.0. This problem was corrected in Microsoft Visual Basic version 3.0 for Windows.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start Visual Basic or from the File menu choose New Project if Visual Basic is already running. Form1 is created by default.

  2. Place a Label (Label1) on Form1.

  3. Set the DragMode property of Label1 to 1(= Automatic).

  4. Add the following code to the Form_DragOver event procedure:

    Unload Form1

  5. Press the F5 key to run the example and try to drag Label1. A GP fault or UAE occurs.


Additional reference words: 2.00 3.00 GPF buglist2.00 fixlist3.00
KBCategory: kbprg kbbuglist
KBSubcategory: PrgCtrlsStd PrgCtrlsCus
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.