T
thomas_okken
I'm working on a little C# DLL that will let me capture audio from
within Internet Explorer. The idea is that the C# object, once it is
recording, will periodically invoke a JavaScript callback, which will
handle the audio somehow.
The JavaScript callback is a simple function, which I pass to the C#
object during its initialization; I then invoke the JavaScript
callback using
theCB.GetType().InvokeMember("", BindingFlags.InvokeMethod, null,
theCB, new object[]
{arg0, arg1, ...});
My problem is that I can't figure out how to pass a C# byte array to
the JavaScript callback. As long as I pass primitive types,
everything's fine, but when I pass a byte[], the JavaScript code
doesn't seem to recognize the object; "for (i in theArray)" finds no
properties, and any attempt to do things like theArray[0] (indexing)
or theArray.Length results in an Exception.
What is the right way to pass an array from C# to JavaScript?
Thanks,
- Thomas
within Internet Explorer. The idea is that the C# object, once it is
recording, will periodically invoke a JavaScript callback, which will
handle the audio somehow.
The JavaScript callback is a simple function, which I pass to the C#
object during its initialization; I then invoke the JavaScript
callback using
theCB.GetType().InvokeMember("", BindingFlags.InvokeMethod, null,
theCB, new object[]
{arg0, arg1, ...});
My problem is that I can't figure out how to pass a C# byte array to
the JavaScript callback. As long as I pass primitive types,
everything's fine, but when I pass a byte[], the JavaScript code
doesn't seem to recognize the object; "for (i in theArray)" finds no
properties, and any attempt to do things like theArray[0] (indexing)
or theArray.Length results in an Exception.
What is the right way to pass an array from C# to JavaScript?
Thanks,
- Thomas