NORMAL LEGAL DISCLAIMERS APPLY TO THIS SOFTWARE. DON'T TRY TO RUN NUCLEAR POWER PLANTS, LIFE-SUPPORT SYSTEMS, OR YOUR TOASTER WITH IT.
This component allows you to convert a JScript array into a Visual Basic (Automation) Array, otherwise known as "Safe Arrays".
The source code is freely available from me, Peter Torr. (If that address fails, try this one, but the first address will get a much quicker response).. It should be available on the web, hanging off the directory http://www.netspace.net.au/~torrboy/code/. The general sort of free-source rules apply - you can do what you want with this code, as long as:
This component is a standard ActiveX DLL, built with Microsoft's ActiveX Template Library (ATL) and Visual C++ 5. It has been marked as "Safe for scripting", but has not been signed.
From the sample file "test.js":
// Create object
var oHelper =
WScript.CreateObject("JScriptHelper.JSafeArray");
// Create test object
var oTester =
WScript.CreateObject("JScriptTester.Test");
// Create JScript Array
var arr =
new Array();
// Put some data in the array
arr[0] = "Hello from JScript!";
arr[1] = 1.234;
arr[2] =
new Date();
// Call the ToArray method
var arrVB =
oHelper.ToSafeArray(arr);
// Call a method that requires a SafeArray
oTester.Test(arrVB);