DOCUMENT:Q193438 29-SEP-1998 [vbwin] TITLE :BUG: Server Not Released if Raise Error in Class_Initialize PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:5.0,6.0 OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0 --------------------------------------------------------------------- SYMPTOMS ======== Raising an error in the Initialize event of a class module in an EXE server keeps the server from being released. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- 1. Create a new ActiveX EXE project in Visual Basic. Class1 is created by default. 2. Add the following code to Class1: Private Sub Class_Initialize() Err.Raise vbObjectError + 1024 End Sub 3. In the Project Properties, set the Project Name to MyServer. 4. Save the project as MyServer.vbp, and then make MyServer.exe. 4. Create a new Standard EXE project. Form1 is created by default. 5. Add the following code to Form1 in the new Standard EXE project: Private Sub Form_Load() Dim oServer As Object On Error GoTo Err_Init Set oServer = CreateObject("MyServer.Class1") Exit Sub Err_Init: Set oServer = Nothing End Sub 6. Run the standard EXE project, and then close it. In Windows 95, press the CTRL+ALT+DEL key combination to open the Close Programs dialog box. -or- In NT 4.0, press the CTRL+ALT+DEL key combination, and then click Task Manager. Note that MyServer.exe is still in memory. Additional query words: kbdss kbDSupport kbVBp600bug kbServer kbActiveX kbOLE kbActivexEvents kbVBp500bug ====================================================================== Version : WINDOWS:5.0,6.0 Platform : WINDOWS Issue type : kbbug ============================================================================= 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. Copyright Microsoft Corporation 1998.