Microsoft KB Archive/193438

= BUG: Server Not Released if Raise Error in Class_Initialize =

Article ID: 193438

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q193438



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.



Steps to Reproduce Behavior
 Create a new ActiveX EXE project in Visual Basic. Class1 is created by default.  Add the following code to Class1: Private Sub Class_Initialize Err.Raise vbObjectError + 1024 End Sub

 In the Project Properties, set the Project Name to MyServer. Save the project as MyServer.vbp, and then make MyServer.exe. Create a new Standard EXE project. Form1 is created by default.  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

</li> Run the standard EXE project, and then close it.

In Windows 95 or Windows Me, press the CTRL+ALT+DEL key combination to open the Close Programs dialog box.

-or-

In Windows NT 4.0 or Windows 2000, press the CTRL+ALT+DEL key combination, and then click Task Manager.

Note that MyServer.exe is still in memory.</li></ol>

Keywords: kbbug kbserver kbpending kbactivexevents KB193438

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.