There is an error in J COM interface when
passing array of BSTR (strings) as opposed to
array of VARIANTs.
I have a set of test projects for VS 2005 to show it,
and here's the fragment to see how easy it
is to accomodate a BSTR array when VARIANT is already
supported (rank and processing are simplified):
int SetB(BSTR jname, VARIANT* v) {
...
SAFEARRAY *psa = v->parray;
int isBstr = (v->vt & VT_TYPEMASK) == VT_BSTR;
_variant_t elem(L""); // same with other MS VC++ variants
for (long i=0; i<size; i++) {
ndx[0] = 0; ndx[rank-1] = i;
if (isBstr) {
SafeArrayGetElement(psa, ndx, &elem.bstrVal);
} else {
SafeArrayGetElement(psa, ndx, &elem);
}
if (i>0) res += ",";
res += (_bstr_t)elem; // just concat array strigns
}
...
Justification:
http://www.jsoftware.com/jwiki/Guides/.NET_Interop
http://www.jsoftware.com/jwiki/DB/ADO.NET_Array_Adapter
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm