How to convert a byte array from ActiveX control to an Array object

L

Lei Lei Shi

Hello Everyone,

In my javascript, an ActiveX control returns a byte array, say block. But by
any means I just can not access it. The typeof operator says its time is
unknown, any call to this object will fail, either toArray or toString. Of
course, indexing by [] will fail. Then I tried type casting in the way I
know:

var test = (Object) block;
var test = (Array) block;
var test = (byte[]) block;
var test = (Object[]) block;
var test = (String)block;

But seems javascript doesn't support casting in that way. So I tried to
contruct object from that:

var test = new Object(block);
var test = new Array(block);
var test = new String(block);

But none of above let me access the bytes inside the array.

Is there anyone successed in getting a byte array from an ActiveX control?

Thanks,
Lei Lei Shi
 
L

Lew

Lei said:
Hello Everyone,

In my javascript, an ActiveX control returns a byte array, say block.
But by
any means I just can not access it. The typeof operator says its time is
unknown, any call to this object will fail, either toArray or toString. Of
course, indexing by [] will fail. Then I tried type casting in the way I
know:

var test = (Object) block;
var test = (Array) block;
var test = (byte[]) block;
var test = (Object[]) block;
var test = (String)block;

But seems javascript doesn't support casting in that way. So I tried to
contruct object from that:

var test = new Object(block);
var test = new Array(block);
var test = new String(block);

But none of above let me access the bytes inside the array.

Is there anyone successed in getting a byte array from an ActiveX control?

You will likely get the help you need in a Javascript newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top