You are currently offline, waiting for your internet to reconnect

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

This article was previously published under Q193172
SYMPTOMS
When the project type of an ActiveX server is changed from DLL to EXE andrecompiled, any client code that attempts to create an instance of anobject 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 projecttype from DLL to EXE. In project compatibility, Visual Basic preserves theClass ID (CLSID) of the class but not the Interface ID (IID). Because theCLSID is preserved, the class ends up being registered with two servers;the in-proc server (DLL) and the local server (EXE). As you create aninstance 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 aboveerror 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 inthe Microsoft Knowledge Base as it becomes available.
MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new ActiveX DLL project in Visual Basic. Class1 is created by default.
  2. 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."
  3. Paste the following code into Class1:
          Public Test As Collection 						
  4. Compile the DLL by selecting Make Server.dll from the File menu.
  5. Start another instance of Visual Basic and create a new Standard EXE project. Form1 is created by default.
  6. Select References from the Project menu and make a reference to Server.
  7. Paste the following code in Form1:
          Private Sub Form_Load()         Dim x as Server.Class1         set x = new Server.Class1      End Sub						
  8. Press the F5 key to run the project. No error is produced.
  9. 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.
  10. Recompile the project by selecting Make Server.EXE from the File menu.
  11. 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
  12. 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."
kbdss kbDSupport kbVBp kbVBp600 kbCompiler kberrmsg
Properties

Article ID: 193172 - Last Review: 05/13/2003 19:20:00 - Revision: 3.0

  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition
  • kbprb KB193172
Feedback