Passing arrays between COM objects 
Author Message
 Passing arrays between COM objects

Try wrapping the returned reference to an array of bytes in extra parens in the
pass to the other method.  As long as ObjB.RecieveArrayOfBytes doesn't need to
modify the array, this should work.  The ReceiveBlah.. method must expect a
strongly typed ByRef argument.  COM's IDispatch won't coerce the VBScript
variant in this case.  If it were a ByVal argument, then it would be coerced.
I've been able to receive byte arrays from COM object's (in ASP using VBScript)
and pass them on to ByVal arguments of other COM objects (Response.BinaryWrite
to be specific).

ObjB.RecieveArrayOfBytes((ObjA.ReturnArrayOfBytes))

--
Michael Harris


| In my ASP page (using VBScript), I have an object ObjA that returns an
| array of bytes (ArrByte). I need to pass the array of bytes (ArrByte) to
| another object ObjB.
|
|     ObjB.RecieveArrayOfBytes( ObjA.ReturnArrayOfBytes )
|
| I got a type mismatch error. Suspect it is due to VBScript having only
| variant type. Any help is appreciated.
|
| Thanks in advance!
|
| HAwk
|



Wed, 10 Apr 2002 03:00:00 GMT  
 Passing arrays between COM objects
In my ASP page (using VBScript), I have an object ObjA that returns an
array of bytes (ArrByte). I need to pass the array of bytes (ArrByte) to
another object ObjB.

    ObjB.RecieveArrayOfBytes( ObjA.ReturnArrayOfBytes )

I got a type mismatch error. Suspect it is due to VBScript having only
variant type. Any help is appreciated.

Thanks in advance!

HAwk



Thu, 11 Apr 2002 03:00:00 GMT  
 Passing arrays between COM objects
In article


Quote:
> In my ASP page (using VBScript), I have an object ObjA that returns an
> array of bytes (ArrByte). I need to pass the array of bytes (ArrByte)
to
> another object ObjB.

>     ObjB.RecieveArrayOfBytes( ObjA.ReturnArrayOfBytes )

> I got a type mismatch error. Suspect it is due to VBScript having only
> variant type. Any help is appreciated.

> Thanks in advance!

> HAwk

FYI.....
I had a similar problem trying to run commercial components (the iTwain
and Kodak IMGSCAN components). These components were written in C++ and
were expecting an array of singles on method calls. The components
would not accept an array of variants and returned the type mismatch
error. Converting the variant to subtype single did not help.

So I concluded that I could not run these components from VBscript.
Hopefully you have some control over your components.

--
Erik Slotboom

Sent via Deja.com http://www.deja.com/
Before you buy.



Fri, 12 Apr 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Passing Arrays to COM Object Slows Performance

2. Passing array to COM object

3. Passing Array to COM Object

4. automation error - passing array to com object

5. Passing array using COM objects

6. Passing array using COM objects

7. Passing array from COM object to ASP

8. Passing array using COM objects

9. Passing an Array object to a C++ COM object

10. Passing a vjscript byte array to a C++ COM object

11. Passing Multi-Dimensional arrays to COM objects from VBScript/ASP

12. Passing arrays to COM java objects from JScript (Server Side)

 

 
Powered by phpBB® Forum Software