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.
MORE INFORMATION
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.
Select References from the Project menu, and add a reference to SPP2.dll.
In Form1, place the following code:
Private Sub Form_Load()
Dim x As SPP2.Class1
Set x = New Class1
End Sub
Switch back to the first instance of Visual Basic and run SPP2.
Switch back to the second instance of Visual Basic and press the F8 key to step into the code.
Continue to press the F8 key until the Error 430 DialogBox pops up.
Additional query words:
Keywords : kbActiveX kbAppSetup kbide kbVBp kbVBp600 kbGrpVB kbDSupport
Version : :6.0
Platform :
Issue type : kbprb
Technology :
Private mvarGeometry As IGeometry
Private mvarLayer As IFeatureLayer
Private mvarDisplay As IScreenDisplay
Private mvarMap As IMap
Private mvarView As IActiveView
Private mvarParent As Form
Private mvarOledb_Tab As Boolean
Private mvarField As String
Private mvarConnection As
Public Property Let Field(ByVal vData As String)
mvarField = vData
End Property
Public Property Get Field() As String
Field = mvarField
End Property
Public Property Let Oledb_Tab(ByVal vData As Boolean)
mvarOledb_Tab = vData
End Property
Public Property Get Oledb_Tab() As Boolean
Oledb_Tab = mvarOledb_Tab
End Property
Public Property Set Parent(ByVal vData As Object)
Set mvarParent = vData
End Property
Public Property Get Parent() As Object
Set Parent = mvarParent
End Property
Public Sub Show(Optional pos_Top As Long, Optional pos_Left As Long)
Set frmIdentify.Map = mvarMap
Set frmIdentify.View = mvarView
Set frmIdentify.Display = mvarDisplay
frmIdentify.Table = mvarOledb_Tab
frmIdentify.Field = mvarField
frmIdentify.Connection = mvarConnection
If SelectObjectsInDisplay(mvarGeometry, mvarMap, mvarLayer) Then
If Not IsMissing(pos_Top) Then
frmIdentify.Top = pos_Top
End If
If Not IsMissing(pos_Left) Then
frmIdentify.Left = pos_Left
End If
frmIdentify.Show
End If
End Sub
Public Property Set View(ByVal vData As IActiveView)
Set mvarView = vData
End Property
Public Property Get View() As IActiveView
Set View = mvarView
End Property
Public Property Set Map(ByVal vData As IMap)
Set mvarMap = vData
End Property
Public Property Get Map() As IMap
Set Map = mvarMap
End Property
Public Property Set Display(ByVal vData As IScreenDisplay)
Set mvarDisplay = vData
End Property
Public Property Get Display() As IScreenDisplay
Set Display = mvarDisplay
End Property
Public Property Set Layer(ByVal vData As IFeatureLayer)
Set mvarLayer = vData
End Property
Public Property Get Layer() As IFeatureLayer
Set Layer = mvarLayer
End Property
Public Property Set Geometry(ByVal vData As IGeometry)
Set mvarGeometry = vData
End Property
Public Property Get Geometry() As IGeometry
Set Geometry = mvarGeometry
End Property
Public Property Set Connection(ByVal vNewValue As Connection)
Set mvarConnection = vNewValue
End Property
Public Property Get Connection() As Connection
Set Connection = mvarConnection
End Property