LPSAFEARRAY *
is a pointer to SAFEARRAY *
, so you need a double pointer, like this:
{
CComSafeArray<VARIANT> vArray;
SAFEARRAY** pArray;
pArray = vArray.GetSafeArrayPtr();
}
And then you can pass the SAFEARRAY *
to the function that needs it as an argument by dereferencing the pointer returned from CComSafeArray
:
DummyFunction(*pArray);