0

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++;
    }   
}
2
Contributors
2
Replies
14
Views
4 Years
Discussion Span
Last Post by Guruprasad_1
0

I have read that. It requires a VARIANT element to be added. I have a double datatype value.. Is there a way I insert this double value?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.