
How does a WSH pass a Variant array to a script
I have been building a C++, WSH type DLL to access the
VBScript engine. One
problem I am stuck on is how to pass a Variant array to a Script function.
From VB, I have used the ScriptControl and been able to use:
Private vActions
Private vArg()
ReDim vArgs(3)
vArgs(0) = xxx
vArgs(1) = yyy
.....
vActions = SC.Run("Evaluate", vArgs)
To load an array with input parameters, and pass then to a script, that
looks like:
Sub Evaluate(vArgs)
item1 = vArgs(0)
...
End Sub
I can't figure out how to do the same in MSVC++. I can use the
::AddNamedItem and GetItemInfo pairs to handle objects in a script. I can't
figure out how to pass the variant array. The VBScript engine doesn't
appear to use the GetItemInfo to find out about the vArgs array.
Does anyone have any ideas.
Jan Wiewiora