Microsoft KB Archive/193172

= PRB: Runtime Error 430 in Client After Server Type is Changed =

Article ID: 193172

Article Last Modified on 5/13/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 Q193172



SYMPTOMS
When the project type of an ActiveX server is changed from DLL to EXE and recompiled, any client code that attempts to create an instance of an object from the server generates the following error:

"Run-time error '430' : Class does not support Automation or does not

support expected interface."



CAUSE
The error results from project compatibility and the change of the project type from DLL to EXE. In project compatibility, Visual Basic preserves the Class ID (CLSID) of the class but not the Interface ID (IID). Because the CLSID is preserved, the class ends up being registered with two servers; the in-proc server (DLL) and the local server (EXE). As you create an instance of the class from a client, the class from the DLL is chosen. Because the class from the DLL does not support the new IID, the above error occurs.



RESOLUTION
Use the RegSvr32.EXE utility to unregister the old DLL server and re- register the new EXE server to eliminate this error.



STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
 Create a new ActiveX DLL project in Visual Basic. Class1 is created by default. Select Project1 in the Project Explorer and press the F4 key to bring up the Property Window. In the Property Window, change the value of (Name) to "Server."  Paste the following code into Class1: Public Test As Collection  Compile the DLL by selecting Make Server.dll from the File menu. Start another instance of Visual Basic and create a new Standard EXE project. Form1 is created by default.</li> Select References from the Project menu and make a reference to Server.</li>  Paste the following code in Form1: Private Sub Form_Load Dim x as Server.Class1 set x = new Server.Class1 End Sub

</li> Press the F5 key to run the project. No error is produced.</li> Switch back to the Server project. Select Server Properties from the Project menu. Select the General tab and change the Project Type to ActiveX EXE.</li> Recompile the project by selecting Make Server.EXE from the File menu.</li> Switch back to the client instance of Visual Basic. Select References from the Project menu. Remove the reference to Server.dll and check Server.EXE</li> Press the F5 key to run the project, and note that the following error occurs:

"Run-time error '430' : Class does not support Automation or does not

support expected interface."

</li></ol>

Additional query words: kbdss kbDSupport kbVBp kbVBp600 kbCompiler kberrmsg

Keywords: kbprb KB193172

-

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

© Microsoft Corporation. All rights reserved.