OS NT VB 5.0
Is it possible to return an Array from a DLL(created with VB) to the Caller VB program. I can pass back variables but not the array ?
An example of the code will be grate.
Thanks
:cool:
Printable View
OS NT VB 5.0
Is it possible to return an Array from a DLL(created with VB) to the Caller VB program. I can pass back variables but not the array ?
An example of the code will be grate.
Thanks
:cool:
I've never user VB5, but it can't be that different.
Try returning a Variant, or passing in an uninitialized array to be filled. That's the way I go anyway...
VB Code:
Private Function FillArray(arrRet() As String) As Boolean 'Redim the array and fill it. If the fill is successful, 'return True. If it is not successful, or an error is 'raised, return False. End Function Private Sub Form_Load() Dim arrRet() As String Dim x As Long If FillArray(arrRet) Then For x = LBound(arrRet) To UBound(arrRet) Debug.Print arrRet(x) Next Else MsgBox "Array Not Filled!" End If End Sub
Passing the arway as empty works very well.
Thanks