Microsoft KB Archive/193087

= BUG: Cannot Run a Compiled ActiveX DLL From IE =

Article ID: 193087

Article Last Modified on 5/13/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
 * Microsoft Internet Explorer 4.0 128-Bit Edition
 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q193087



SYMPTOMS
Internet Explorer (IE) fails to load an ActiveX DLL that is compiled in Microsoft Visual Basic 5.0 or 6.0.



CAUSE
The Class_Initialize event is not fired correctly.



RESOLUTION
In Visual Basic 6.0, run the DLL project in the Visual Basic IDE (Integrated Development Environment) before loading it in IE to correct this problem.

There is no resolution for a Visual Basic 5.0 project.



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 DLL project in Visual Basic. Class1 is created by default. Add a new form (Form1) to the project.  Paste the following code into Class1: Option Explicit

Private myform As Form1

Private Sub Class_Initialize Set myform = New Form1 myform.Visible = True End Sub

Private Sub Class_Terminate Set myform = Nothing End Sub

 Save the project. Compile the project by selecting Make Project1.dll from the File menu.</li> Select Add-In Manager under Add-Ins and check Visual Basic 6.0 Package and Deployment Wizard (PDW) to load it.</li> Start the PDW by selecting it from the Add-Ins menu.</li> Select Package. In the Package Type screen, select Internet Package and click Next. Follow the PDW to completion. The PDW will create a HTM file for your project in your desired Package directory.</li> Press the F5 key to run the project in the IDE. Select "Wait for component to be created" and click OK.</li> Launch Internet Explorer and browse to the HTM file created in step 8. The form shows up correctly.</li> Close IE and stop the Visual Basic project from running in the IDE.</li> Reopen IE and browse to the HTM file again. The page loads without error, but the form is not created.</li></ol>

Keywords: kbbug kbaddin kbwizard kbpending KB193087

-

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

© Microsoft Corporation. All rights reserved.