Passing JScript string array to Activex

I want to pass anJScript string array tojava script. Can anyone explain me how to do it.

Thanks

[147 byte] By [smk_k] at [2008-2-13]
# 1

VARIANT varParams; //this is a JScript array passed in

//if not VT_DISPATCH then return.
if(varParams.vt!=VT_DISPATCH)
return E_INVALIDARG;

//get the IDispatchEx of varParams
CComPtr<IDispatchEx> pDispEx;
HRESULT hr=varParams.pdispVal->QueryInterface(IID_IDispatchEx,(void**)&pDispEx);
if(FAILED(hr))
return E_INVALIDARG;

//Enum all the properties of the jscript array.
DISPID dispid;

//get the DISPID of the first item.
hr = pDispEx->GetNextDispID(fdexEnumAll, DISPID_STARTENUM, &dispid);
while (hr == NOERROR)
{
//get the item name
CComBSTR bstrName;
hr = pDispEx->GetMemberName(dispid, &bstrName);
if (FAILED(hr))
return E_FAIL;
//get the item value
CComVariant vValue;
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
hr = pDispEx->InvokeEx(dispid, LOCALE_USER_DEFAULT,
DISPATCH_PROPERTYGET, &dispparamsNoArgs,
&vValue, NULL, NULL);
if(FAILED(hr))
return E_FAIL;

//get the DISPID of the next item.
hr = pDispEx->GetNextDispID(fdexEnumAll, dispid, &dispid);
}

kevin7776 at 2007-8-31 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Extension Development...