I wrote a small test COM dll to try different ways of passing an array between LV and COM. The three ways I tried are:
1. Variant of type SAFEARRAY
2. SAFEARRAY
3. Pointer to first element of array with a size_is specifier
__interface IArrayFunctions : IDispatch
{
[id(1), helpstring("method GetArray1")] HRESULT GetArray1([out] VARIANT* Arr);
[id(2), helpstring("method GetArray2")] HRESULT GetArray2([out, satype("LONG")] SAFEARRAY** Arr);
[id(3), helpstring("method GetArray3")] HRESULT GetArray3([out, size_is(ArrElements)] LONG* Arr, [in] int ArrElements);
};
1 and 2 work, 3 does not. In LV GetArray3's first parameter is just a LONG value. Any way to make the pointer to array argument work in LV? I've seen some functions being imported into LV like MoveBlock, is that a possibility?