J
Jacques Wentworth
Hi
I'm trying to pass a collection from a .NET DLL to a VB6 app. I get a
error 13 (type mismatch) when I do so. I passed back a boolean variable
without any problems, but when I try the collection I get the error.
As you can see the function does not do anything at the moment, so it
must be some issue passing the collection.
Thanks
..NET
Public Interface IHSTCradleData
'Function Fetch(ByVal intFacility As Integer, _
' ByVal intMonth As Integer, _
' ByVal intYear As Integer) As Boolean
Function Fetch(ByVal intFacility As Integer, _
ByVal intMonth As Integer, _
ByVal intYear As Integer) _
As Microsoft.VisualBasic.Collection
End Interface
Public Class HSTCradleData
Implements IHSTCradleData
Function Fetch(ByVal intFacility As Integer, _
ByVal intMonth As Integer, _
ByVal intYear As Integer) _
As Microsoft.VisualBasic.Collection _
Implements IHSTCradleData.Fetch
Return New Collection
End Function
End Class
VB6
Dim x As New HSTCradleData.HSTCradleData
Dim c As Collection
Set c = x.Fetch(txtFacCode.Text, txtMonth.Text, txtYear.Text)
MsgBox c.Count
I'm trying to pass a collection from a .NET DLL to a VB6 app. I get a
error 13 (type mismatch) when I do so. I passed back a boolean variable
without any problems, but when I try the collection I get the error.
As you can see the function does not do anything at the moment, so it
must be some issue passing the collection.
Thanks
..NET
Public Interface IHSTCradleData
'Function Fetch(ByVal intFacility As Integer, _
' ByVal intMonth As Integer, _
' ByVal intYear As Integer) As Boolean
Function Fetch(ByVal intFacility As Integer, _
ByVal intMonth As Integer, _
ByVal intYear As Integer) _
As Microsoft.VisualBasic.Collection
End Interface
Public Class HSTCradleData
Implements IHSTCradleData
Function Fetch(ByVal intFacility As Integer, _
ByVal intMonth As Integer, _
ByVal intYear As Integer) _
As Microsoft.VisualBasic.Collection _
Implements IHSTCradleData.Fetch
Return New Collection
End Function
End Class
VB6
Dim x As New HSTCradleData.HSTCradleData
Dim c As Collection
Set c = x.Fetch(txtFacCode.Text, txtMonth.Text, txtYear.Text)
MsgBox c.Count