S
versuch es ohne ATL:
// bounds && create
SAFEARRAYBOUND rgb [] = { 1, 0 };
SAFEARRAY *pSA = SafeArrayCreate(VT_BSTR, 1, rgb);
// fill && put
BSTR tstBSTR;
LONG rgIndices = 0;
SafeArrayPutElement(pSA, &rgIndices, &tstBSTR);
// Initialize and fill the SafeArray
VARIANT vsa;
vsa.vt = VT_BSTR | VT_ARRAY;
V_ARRAY(&vsa) = pSA;