Trouble filling the SafeArray with double datatype values using 'SafeArrayPutElement'. I get E_INVALIDARG error.
*pEventCode is my safearray... dEventCd is the 'double' value...I want to insert the dEventCd values to my *pEventCode safearray one by one when (bPriv) is true... Please help
lResult=SafeArrayUnlock(*pEventCode);
HRESULT hr = SafeArrayDestroyData(*pEventCode);
for(INT_PTR count(0); count < nEventCnt; ++count)
{
mapEventCds.GetNextAssoc(pos, dEventCd, bPriv);
if (bPriv)
{
hr = SafeArrayPutElement(*pEventCode, &iEventCdIdx, &dEventCd);
iEventCdIdx++;
}
}