thinktwice said:
here is the code in server side
STDMETHOD(mySafeArray)(VARIANT *pVal)
{
CComSafeArray<long> arr;
i = 5;
while(i-- > 0)
{
hr = arr.Add(i);
}
CComVariant vtRet;
LPSAFEARRAY pCopy;
if (arr.m_psa != NULL)
{
HRESULT hRes = ::SafeArrayCopy(arr.m_psa, &pCopy);
if (SUCCEEDED(hRes) && pCopy != NULL)
{
::SafeArrayGetVartype(arr.m_psa, &(vtRet.vt));
vtRet.vt |= VT_ARRAY;
vtRet.parray = pCopy;
}
else
{
vtRet.vt = VT_ERROR;
vtRet.scode = hRes;
}
}
return vtRet.Detach(pVal);
}
Truthfully I am not a VBArray expert as I almost never had to use it.
But in any case it's *VB*Array (Visual Basic Array)
Therefore your only options are:
1) Use VBScript on client side instead of JScript (this naturally
exclude all browsers by IE)
2) Use VBScript helper together with JScript - so safe array would come
first to VBScript which understand safe array format - and convert it
later to JavaScript array (this naturally exclude all browsers but IE)
3) Change your server-side procedure so it would return JavaScript
array. I don't see really any problems with the latter (?)