BUG: Server Not Released if Raise Error in Class_Initialize

ID: Q193438


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.


  5. Create a new Standard EXE project. Form1 is created by default.


  6. 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
     


  7. 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

Keywords : kbGrpVB
Version : WINDOWS:5.0,6.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: January 5, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.