VARIANT *variantVariable = new VARIANT; ::VariantInit(variantVariable); variantVariable->vt = VT_ARRAY | VT_INT; SAFEARRAYBOUND bounds[1]; bounds[0].cElements = 100; // array size bounds[0].lLbound = 0; SAFEARRAY *pSafeArray = SafeArrayCreate(VT_INT,1,bounds); // pointer to access the data int *pData; SafeArrayAccessData(pSafeArray,reinterpret_cast<void **>(&pData)); for(Uint offset = 0; 100 > offset; ++offset) { pData[offset] = -1; } SafeArrayUnaccessData(pSafeArray); variantVariable->parray = pSafeArray;
interfaceVariable->COMFUNCTION( variantVariable
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)