I'm making a COM dll in .NET for use in VB6, the dll works fine in VB6.
but I have a problem when I want to assign arrays.
here is the Person class in VB.NET, the Name property is an array of the class called Class2
Public Class Person
Private _name() As Class2
Public Property Name() As Class2()
Get
Return Me._name
End Get
Set
Me._name = value
End Set
End Property
End Class
This is the Class2:
Public Class Class2
Private m_id As String
Public Property id() As String
Get
Return m_id
End Get
Set
m_id = Value
End Set
End Property
End Class
this is the code I'm using in VB6:
Dim vArray(2) As MyLib.Class2
vArray(0).id = "Hello 1"
vArray(1).id = "Hello 2"
vArray(2).id = "Hello 3"
Dim i As New MyLib.Person
i.Name = vArray ' here throws an error