Hi all,
I have to implement a COM class with VB.NET. An object of this class has then to be created from a VB6 DLL. The code for the COM dll is very simple:
Public Class AdapterWrapper
Implements SchemaCompInterfaces.IEFAdapter
#Region "COM-GUIDs"
Public Const ClassId As String = "58faad86-bbac-4b20-9ab5-fe32bdac0a68"
Public Const InterfaceId As String = "f8dbb078-5f1e-4304-a390-3e8e88983f98"
Public Const EventsId As String = "113d2163-f8db-4d99-88e5-58d13b8d2cf4"
#End Region
Public Sub New()
MyBase.New()
End Sub
Public WriteOnly Property CurrentSPFProjectStatus() As SchemaCompInterfaces.SPFProjectStatus Implements SchemaCompInterfaces.IEFAdapter.CurrentSPFProjectStatus
Set(ByVal value As SchemaCompInterfaces.SPFProjectStatus)
End Set
End Property
Public Function DocumentExistsInTool(ByRef oDocumentIObj As SchemaCompInterfaces.IObject) As Boolean Implements SchemaCompInterfaces.IEFAdapter.DocumentExistsInTool
End Function
Following many more functions from the IEFAdapter interface...
The dll and tlb are created and registered.
The test code for the VB6 client to use this COM class is also very simple:
Private Sub Command1_Click()
Dim adapter As SchemaCompInterfaces.IEFAdapter
Set adapter = Interaction.CreateObject("MyEFAdapter.AdapterWrapper")
End Sub
Now when I'm running this code, I'm getting the Run-time error '13' Type mismatch in the CreateObject line. Late binding with
Dim adapter as Object
seems to work for my test code, but is not a solution for me, because I can't change the proprietary VB6 code where the COM object is created. So somehow the interface "SchemaCompInterfaces.IEFAdapter" is not known... :sigh:
Any ideas how to get close to this problem?
In the project properties I checked the flag for registration with COM-Interop. Perhaps something to do with the ClassInterface?
I'm relatively new to VB, so don't answer too complex... ;)
Thanks in advance!
Alex