Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

COM Interop and Multiple interfaces

Hello All,
I have a vb.net class which implements multiple interfaces with different properties.

When I instantiate this class in vb6 I get only those properties which are exposed in the <ComDefaultInterface> attribute.

I want to know how to access properties from all the interfaces in vb6
<InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
<Guid("E311CA-C8DB-463b-86F6-D488BF790FAB")> _
<TypeLibImportClass(GetType(Agent))> _
<ComVisible(True)> _
Public Interface IAgent

End Interface

<InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
<Guid("E311CA-C8DB-463b-86F6-D488BF790FAB")> _
<TypeLibImportClass(GetType(Person))> _
<ComVisible(True)> _
Public Interface IPerson

End Interface

I have tried <InterfaceType(ComInterfaceType.InterfaceIsDual)> _

<Serializable()> _
<ClassInterface(ClassInterfaceType.None)> _
<Guid("07D10B4-D058-4a9b-80CA-8C39CCD88C11")> _
<ProgId("X")> _
<ComDefaultInterface(GetType(IAgent))> _
<ComVisible(True)> _
Public Class Agent
Implements IAgent, IPerson

I also tried

<Serializable()> _
<ClassInterface(ClassInterfaceType.None)> _
<Guid("07D10B4-D058-4a9b-80CA-8C39CCD88C11")> _
<ProgId("X")> _
<ComSourceInterfaces(GetType(IPerson), GetType(IAgent))> _
<ComVisible(True)> _
Public Class Agent
Implements IAgent, IPerson

end Class
[1709 byte] By [.NetDoubts] at [2007-11-11 10:24:43]