Microsoft KB Archive/190131

= PRB: Instantiating a Project-Compatible Server Causes Error 430 =

Article ID: 190131

Article Last Modified on 5/12/2003

-

APPLIES TO


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

-



This article was previously published under Q190131



SYMPTOMS
Instantiating a class within a server that has been previously compiled but is now running within the Visual Basic IDE, causes run-time error 430.



CAUSE
When a Visual Basic project is compiled with Project Compatibility, the CLSID remains the same while the IID changes for subsequent builds. Therefore, attempting to create the specific class in the "compatible" server generates the following error because the specific IID has changed and no longer exists:

Run-time error '430':

Class does not support Automation or does not support expected interface



RESOLUTION
Use Binary Compatibility.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Start a new ActiveX DLL project in Visual Basic. Class1 is created by default. From the Project menu, select Project Properties, and then change the Project Name to SPP2. From the File menu, select Make SPP2.DLL.  Add the following code to the code module of Class1: Private Sub Class_Initialize Debug.Print "Initialize" End Sub  Start a second instance of Visual Basic and create a new Standard EXE project. Form1 is created by default.</li> Select References from the Project menu, and add a reference to SPP2.dll.</li>  In Form1, place the following code: Private Sub Form_Load Dim x As SPP2.Class1 Set x = New Class1 End Sub </li> Switch back to the first instance of Visual Basic and run SPP2.</li> Switch back to the second instance of Visual Basic and press the F8 key to step into the code.</li> Continue to press F8 until the Error 430 DialogBox pops up.</li></ol>

<div class="references_section">