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

Discussion in 'Java' started by Lei Lei Shi, Jul 26, 2007.

  1. Lei Lei Shi

    Lei Lei Shi Guest

    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
     
    Lei Lei Shi, Jul 26, 2007
    #1
    1. Advertising

  2. Lei Lei Shi

    Lew Guest

    Re: How to convert a byte array from ActiveX control to an Arrayobject

    Lei Lei Shi wrote:
    > 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.

    --
    Lew
     
    Lew, Jul 26, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kirby
    Replies:
    3
    Views:
    682
    Kirby
    Oct 8, 2004
  2. Shane Wealti

    convert byte[] to Byte[]

    Shane Wealti, Jun 13, 2005, in forum: Java
    Replies:
    5
    Views:
    42,593
    Brzezi
    Jun 13, 2005
  3. Replies:
    20
    Views:
    9,950
    licebmi
    Sep 7, 2009
  4. Replies:
    5
    Views:
    1,970
    Wesley Hall
    Nov 4, 2006
  5. vml
    Replies:
    0
    Views:
    1,093
Loading...

Share This Page