Passing an Array object to a C++ COM object 
Author Message
 Passing an Array object to a C++ COM object

Does anyone know what sort of object is created my the JScript engine when you
do a "var varArray = new Array(100);"??

I passed it to a C++ COM object and was shocked to discover that it is not a
SAFEARRAY, but is IDispatch based.


Thanks for any help!

Paul



Mon, 14 Jan 2002 03:00:00 GMT  
 Passing an Array object to a C++ COM object
Hi there,


Quote:
> Does anyone know what sort of object is created my the JScript engine when
you
> do a "var varArray = new Array(100);"??

JScript Arrays are like JScript objects - they are IDispatch[Ex] COM
objects, where every element is a named property of the object.

Quote:
> I passed it to a C++ COM object and was shocked to discover that it is not
a
> SAFEARRAY, but is IDispatch based.

Yes; to do this you need to use the JSafeArray component:

http://www.netspace.net.au/~torrboy/code/jsafearr/

(NOTE: I wrote this *before* coming to Microsoft, so it's not supported by
Microsoft or anything like that, although if you have problems I will try
and fix them for you).

I did, but please post any follow-ups to the group. It is not very helpful
to other people reading the group if communication between people is kept
private.

Peter

--

Microsoft Windows Script Program Manager.
http://msdn.microsoft.com/scripting



Mon, 14 Jan 2002 03:00:00 GMT  
 Passing an Array object to a C++ COM object
The next logical question is is this implemented
as a class in MS JScript?  In particular ASP
JScript for IIS 4...



Quote:
> Hi there,



fl1.aol.com...
> > Does anyone know what sort of object is

created my the JScript engine when
Quote:
> you
> > do a "var varArray = new Array(100);"??

> JScript Arrays are like JScript objects - they

are IDispatch[Ex] COM
Quote:
> objects, where every element is a named

property of the object.
Quote:

> > I passed it to a C++ COM object and was

shocked to discover that it is not
Quote:
> a
> > SAFEARRAY, but is IDispatch based.

> Yes; to do this you need to use the JSafeArray
component:

http://www.netspace.net.au/~torrboy/code/jsafearr/
Quote:

> (NOTE: I wrote this *before* coming to

Microsoft, so it's not supported by
Quote:
> Microsoft or anything like that, although if

you have problems I will try
Quote:
> and fix them for you).


> I did, but please post any follow-ups to the

group. It is not very helpful
Quote:
> to other people reading the group if

communication between people is kept

Quote:
> private.

> Peter

> --

> Microsoft Windows Script Program Manager.
> http://msdn.microsoft.com/scripting

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


Sat, 19 Jan 2002 03:00:00 GMT  
 Passing an Array object to a C++ COM object

Quote:

> The next logical question is is this implemented
> as a class in MS JScript?  In particular ASP
> JScript for IIS 4...

Nope, not at this piont in time, I'm afraid. You have to use
http://www.netspace.net.au/~torrboy/code/jsafearr/ or the ScriptX control
from http://www.meadroid.com/ or some other third-party component to do
this.

Peter

--

Microsoft Windows Script Program Manager.
http://msdn.microsoft.com/scripting



Sat, 19 Jan 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

2. Is it possible to pass a C++ NULL to a COM object from JScript

3. Problem with passing result to/from vbscript - Com-object written in C++

4. Passing Arrays to c++ Mts object??

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

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

7. Passing an array from an ASP to a COM object

8. Passing Arrays to COM Object Slows Performance

9. Passing an array from an ASP to a COM object

10. Passing array to COM object

11. Passing Arrays from VBScript to COM Object

12. Passing arrays between COM objects

 

 
Powered by phpBB® Forum Software