BUG: Modal Dialog in Terminate Causes Lockup on Windows 95

Last reviewed: April 11, 1996
Article ID: Q149036
The information in this article applies to:
  • Professional and Enterprise Editions of Microsoft Visual Basic for Windows, 16-bit only, version 4.0

SUMMARY

Displaying a modal dialog in the Terminate event of a class module can cause a lockup of the server providing the class and any clients. This happens with the 16-bit version of Visual Basic 4.0 on the Windows 95 operating system and can be demonstrated by the ds.vbp and thingtst.vbp samples in the oleserv sample directory.

STATUS

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

WORKAROUND

Do not show any modal dialogs in the Terminate event of a class. Showing any modal dialogs, including message boxes, is not recommended in either the Initialize or Terminate events of a class module because it can interfere with the creation and/or termination of objects. Both client and server are halted until the modal dialog is dismissed.

MORE INFORMATION

Steps to reproduce

  1. Start two instances of Visual Basic 4.0, 16-bit, on Windows 95. Load the ds.vbp sample located in the \vb4\samples\oleserv directory and click F5 to start the server application.

  2. Switch to the other running instance of VB4 16 and load the thingtst.vbp sample, which is also located in the \vb4\samples\oleserv directory. Say yes to the Could not create reference dialog box if it appears. The instance of the thing server running in the IDE has changed the registry so that it is used instead of any previously compiled instances of ds.exe. The references need to be changed in the client so this is taken into account.

  3. On the Tools menu, choose References to show the References dialog box. Find the MISSING: Demonstration OLE Server entry and clear it. Close the dialog by clicking OK. Reopen the References dialog and check the Demonstration OLE Server entry.

  4. Run the client application and enter a name for the Form Thing. Click OK, then click OK again to dismiss the message box shown in the Initialize event.

  5. Click the New Form Thing button to set the old object reference to nothing and create a new instance of the Form Thing class. The Thing Terminate modal dialog box displays, but no longer responds to the mouse. The client and server are locked up at this point. The server can be shut down with the Close Program dialog (CTRL+ALT+DELETE and End Task).


KBCategory: kbprg kbbuglist
KBSubcategory: APrgOther
Additional reference words: 4.00 vb4win vb4all



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: April 11, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.