Calling ActiveX component with array parameter 
Author Message
 Calling ActiveX component with array parameter

I have a ActiveX component with a method that takes an array of Strings as
one of its parameters. The component was written in VB. When I try to call
this method from ASP I get a Subscript out of range error. How do I pass an
the array to a VB component. Code looks something like this.

Dim myArray(1)
myArray(0) = "One"
myArray(1) = "Two"
myVal = component.buildList(Cstr(P1), CLng(P2), myArray)

Thanks in advance.
--

Don Miller
Integic Corporation



Tue, 01 Apr 2003 03:00:00 GMT  
 Calling ActiveX component with array parameter

hi Don,

I think you are out of luck on this one.  As you know, VBScript variables
are "variants", and of course you can store an array of strings in a variant
array.

Howeve, when you pass the (variant) array of strings, I think your component
is going to throw up, (because things are not going to be in the right
places).

If you have just one string (not an array), and want to pass it to a
component, then you can "type-convert" the string, using
CStr(myVariantString), and the string will get passed properly.  But,
(afaik), you can't type-convert an array...

If you have access to the component source, your best bet is to declare your
string array as a variant array in your conponent, and then just access the
strings the same way as you would in vbscript.

cheers, jw


Quote:
> I have a ActiveX component with a method that takes an array of Strings as
> one of its parameters. The component was written in VB. When I try to call
> this method from ASP I get a Subscript out of range error. How do I pass
an
> the array to a VB component. Code looks something like this.

> Dim myArray(1)
> myArray(0) = "One"
> myArray(1) = "Two"
> myVal = component.buildList(Cstr(P1), CLng(P2), myArray)

> Thanks in advance.
> --

> Don Miller
> Integic Corporation



Tue, 01 Apr 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. passing array as parameter to activex component

2. passing array as parameter to activex component

3. VBS to VB6 Component Array parameters?

4. Passing Arrays between ASP/VBScript and ActiveX Components...

5. Passing Arrays between ASP/VBScript and ActiveX Components...

6. Passing an array from ASP to VB 6 ActiveX component

7. Passing an array from ASP to VB 6 ActiveX component

8. Activex dll call and Array type problem

9. calling activex with non-variant parameters from asp

10. Calling VB ActiveX dll from VC++ junks up optional variant parameters values

11. help ActiveX Error : ActiveX component can't create object

12. ActiveX Error : ActiveX component can't create object

 

 
Powered by phpBB® Forum Software