Mr.No
-
Total Posts
:
7
- Scores: 0
-
Reward points
:
0
- Joined: 11/18/2005
-
Status: offline
|
Pick up String Array from a VB6 DLL
Wednesday, February 01, 2006 4:59 AM
( permalink)
Hi I have a VB6 DLL that I've instantiated from a VBScript script and I want to pick up the String array returned by one of the methods but I'm getting a type mismatch error. Here's an example of what I'm doing.
Option Explicit
Dim pvArrBatches
Dim oExport
Set oExport = CreateObject("SampleVB6.Export")
pvArrBatches = oExport.GetBatchList
MsgBox IsArray(pvArrBatches) ' shows True
Msgbox "Ubound " & Ubound(pvArratches) ' shows 1 when 2 items are present in the array
Msgbox pvArrBatches(0) '' Type mismatch error
The VB6 DLL exposes a method as follows:
Public Function GetBatchList() As String()
' build string array
GeBatchList = pvArrStrList ' where pvArrStrList is a correcly populated string array
End Function
Is there anyway I could pick up the string array exposed by my VB6 DLL? Thanks
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
RE: Pick up String Array from a VB6 DLL
Wednesday, February 01, 2006 5:56 AM
( permalink)
Does this work? Msgbox CStr(pvArrBatches(0))
|
|
|
|
Mr.No
-
Total Posts
:
7
- Scores: 0
-
Reward points
:
0
- Joined: 11/18/2005
-
Status: offline
|
RE: Pick up String Array from a VB6 DLL
Friday, February 03, 2006 9:32 AM
( permalink)
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
RE: Pick up String Array from a VB6 DLL
Friday, February 03, 2006 9:42 AM
( permalink)
Hmmm...annoying but not completely unexpected since all VBScript vars are variants.
|
|
|
|