Expose your class to com, and for the parameter create a new class that is also exposed to com but implements the IList interface. I successfully used the following code in an assembly that was exposed to COM:
Code:
Imports System.Runtime.InteropServices
Public Interface IClass1
Function Concater(ByVal strings As Items) As String
End Interface
<ClassInterface(ClassInterfaceType.None)> _
Public Class Class1
Implements IClass1
Public Function Concater(ByVal strings As Items) As String Implements IClass1.Concater
Dim counter As Integer
Dim sb As New Text.StringBuilder
Dim str As String
For Each str In strings
sb.Append(str)
Next
Return sb.ToString
End Function
End Class
<ClassInterface(ClassInterfaceType.None)> _
Public Class Items
Implements IList
Private mdict As New ArrayList
Public Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements System.Collections.ICollection.CopyTo
mdict.CopyTo(array, index)
End Sub
Public ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count
Get
Return mdict.Count
End Get
End Property
Public ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized
Get
Return mdict.IsSynchronized
End Get
End Property
Public ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot
Get
Return mdict.SyncRoot
End Get
End Property
Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
Return mdict.GetEnumerator
End Function
Public Function Add(ByVal value As Object) As Integer Implements System.Collections.IList.Add
Return mdict.Add(value)
End Function
Public Sub Clear() Implements System.Collections.IList.Clear
mdict.Clear()
End Sub
Public Function Contains(ByVal value As Object) As Boolean Implements System.Collections.IList.Contains
Return mdict.Contains(value)
End Function
Public Function IndexOf(ByVal value As Object) As Integer Implements System.Collections.IList.IndexOf
Return mdict.IndexOf(value)
End Function
Public Sub Insert(ByVal index As Integer, ByVal value As Object) Implements System.Collections.IList.Insert
mdict.Insert(index, value)
End Sub
Public ReadOnly Property IsFixedSize() As Boolean Implements System.Collections.IList.IsFixedSize
Get
Return mdict.IsFixedSize
End Get
End Property
Public ReadOnly Property IsReadOnly() As Boolean Implements System.Collections.IList.IsReadOnly
Get
Return mdict.IsReadOnly
End Get
End Property
Default Public Property Item(ByVal index As Integer) As Object Implements System.Collections.IList.Item
Get
Return mdict.Item(index)
End Get
Set(ByVal Value As Object)
mdict.Item(index) = Value
End Set
End Property
Public Sub Remove(ByVal value As Object) Implements System.Collections.IList.Remove
mdict.Remove(value)
End Sub
Public Sub RemoveAt(ByVal index As Integer) Implements System.Collections.IList.RemoveAt
mdict.RemoveAt(index)
End Sub
End Class