
Passing an array through the COM interface in ATL
Hello,
I would like to passing an array through the COM
interface, but it does not succeed.
In my case, i have :
STDMETHODIMP ComCtrl::GetSelectedArray( /*[out]*/BSTR
*bstrVal){
CComBSTR combStr1= "test01";
CComBSTR combStr2= "test02";
CComBSTR combStr3= "test03";
*(bstrVal+0) = combStr1;
*(bstrVal+1) = combStr2;
*(bstrVal+2) = combStr3;
return 0;
Quote:
}
In another side:
BSTR bstVal[10];
GetSelectedArray(bstVal);
I have checked the result, the value of bstVal[0]~[2] are
all equal "test03"?
Why i cannot pass the array in such way ? Can someone show
me the true method to pass the array ?
Thank you
David