d00_ape Posted October 25, 2004 Share Posted October 25, 2004 Hi! I?m about to pass a VARIANT to a ?COM-function?. In the API I says I should pass: an Array of VARIANTS. How do I create the array. I have looked at the function SafeArrayPutElement(?) and managed to pass an Array of BSTR? but I do need to pass it like an VARIANT Array?.? Tips? Link to comment Share on other sites More sharing options...
0 azcodemonkey Posted October 25, 2004 Share Posted October 25, 2004 Hi!I?m about to pass a VARIANT to a ?COM-function?. In the API I says I should pass: an Array of VARIANTS. How do I create the array. I have looked at the function SafeArrayPutElement(?) and managed to pass an Array of BSTR? but I do need to pass it like an VARIANT Array?.? Tips? 584802721[/snapback] Assuming you're using C++(from MSDN): SAFEARRAY* psa; SAFEARRAYBOUND bnds[1]; bnds[0].lLbound = 0; bnds[1].cElements = 5; psa = SafeArrayCreate( VT_VARIANT, 1, bnds ); if( psa == NULL ) return E_OUTOFMEMORY; // use array return NOERROR; Link to comment Share on other sites More sharing options...
Question
d00_ape
Hi!
I?m about to pass a VARIANT to a ?COM-function?.
In the API I says I should pass: an Array of VARIANTS.
How do I create the array.
I have looked at the function SafeArrayPutElement(?) and managed to pass an Array of BSTR? but I do need to pass it like an VARIANT Array?.?
Tips?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts