Passing arrays to COM java objects from JScript (Server Side) 
Author Message
 Passing arrays to COM java objects from JScript (Server Side)

I am trying to pass an array to my Java COM object from ASP server-side
JScript code.

This use to work perfectly using VBScript but does not with JScript.  Since
I ported most of my code to JScript, I wish I will not have to switch
back...

This is what I do:

var myComObject = ...;

var testArray1 = new Array("test1", "test2");
var testArray2 = new Array(1,2);

myComObject.takeArrays(testArray1, testArray2);

I then get an "unspecified error" from the script interpretor.  Note that
the method takeArray in myComObject does not even get called.

Any idea?  Thanks!

Claude.



Sat, 24 Feb 2001 03:00:00 GMT  
 Passing arrays to COM java objects from JScript (Server Side)
We have addressed this in the soon to be released V5 beta 2 (don't ask me
the date yet - just soon at the moment I'm afraid)  When you pass a JScript
array out to either VBScript or another object it will be treated as a
collection so you can create a VB array from it

--
Regards

Andrew Clinick
Microsoft Scripting Program Manager
http://msdn.microsoft.com/scripting

Quote:

>JScript arrays are quite different from VBS's ones. They are sparse.
Actually,
>JScript array is much like JScript object, it's a collection of properties
>accessible through IDispatchEx interface, not SAFEARRAY. Unfortunately,
there is
>no conversion routine from JS array to VBS one. The possible solution would
be
>to use VBS helpers to make a conversion, still I guess you're getting rid
of VBS
>code, not to say about mixing VBScript and JScript on the same page...

>-cap.


>I am trying to pass an array to my Java COM object from ASP server-side
>JScript code.

>This use to work perfectly using VBScript but does not with JScript.  Since
>I ported most of my code to JScript, I wish I will not have to switch
>back...

>This is what I do:

>var myComObject = ...;

>var testArray1 = new Array("test1", "test2");
>var testArray2 = new Array(1,2);

>myComObject.takeArrays(testArray1, testArray2);

>I then get an "unspecified error" from the script interpretor.  Note that
>the method takeArray in myComObject does not even get called.

>Any idea?  Thanks!

>Claude.



Sat, 24 Feb 2001 03:00:00 GMT  
 Passing arrays to COM java objects from JScript (Server Side)
JScript arrays are quite different from VBS's ones. They are sparse. Actually,
JScript array is much like JScript object, it's a collection of properties
accessible through IDispatchEx interface, not SAFEARRAY. Unfortunately, there is
no conversion routine from JS array to VBS one. The possible solution would be
to use VBS helpers to make a conversion, still I guess you're getting rid of VBS
code, not to say about mixing VBScript and JScript on the same page...

-cap.

I am trying to pass an array to my Java COM object from ASP server-side
JScript code.

This use to work perfectly using VBScript but does not with JScript.  Since
I ported most of my code to JScript, I wish I will not have to switch
back...

This is what I do:

var myComObject = ...;

var testArray1 = new Array("test1", "test2");
var testArray2 = new Array(1,2);

myComObject.takeArrays(testArray1, testArray2);

I then get an "unspecified error" from the script interpretor.  Note that
the method takeArray in myComObject does not even get called.

Any idea?  Thanks!

Claude.



Sun, 25 Feb 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help converting server-side VBScript array into client-side JScript array

2. Passing Array from JScript to COM Server

3. Passing Array from JScript to COM Server

4. Catching COM object errors in server-side jscript?

5. Passing Server Side Arrays to Client Side Scripts

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

7. getting server side vbscript array to client side jscript

8. getting server side vbscript array to client side jscript

9. Java COM, ASP JScript and arrays

10. Jscript client-side and server-side objects

11. Retreiving data from Java server through WinSock COM object

12. Retreiving data from Java server through WinSock COM object

 

 
Powered by phpBB® Forum Software