SAFEARRAY in Variant
COM
2
Posts
2
Posters
0
Views
1
Watching
-
I pass a
SAFEARRAY
through aVariant
in VB. Now i have theVariant
and i don't know how to extract theSAFEARRAY
from it. rechiSTDMETHODIMPL MyCOMClass::VBMethod(VARIANT * vt) { SAFEARRAY *psa; if(vt == NULL) return E_POINTER; //assuming safearray consists BSTR. if not change to appropriate sa datatype if(vt->vt != VT_BSTR | VT_ARRAY) { return E_INVALIDARG; } psa = vt->parray; ATLASSERT(psa != NULL); //use safe array here return S_OK; } Hth, Ramu