A while back we had this: Returning/Detecting Empty Arrays.
Calling SafeArrayCreateVector() to make "no elements" arrays that return UBound() of -1 is pretty useful.
But what if you have dynamic arrays of private UDT types?
"Private" in the sense that there is no typelib for them defining the structure info used by IRecordInfo.
That said I'm not even sure the call works for public UDTs. You'd probably need to use SafeArrayCreateVectorEx() instead and figure out a clean way to fetch the IRecordInfo to pass to it.
Calling SafeArrayCreateVector() to make "no elements" arrays that return UBound() of -1 is pretty useful.
But what if you have dynamic arrays of private UDT types?
"Private" in the sense that there is no typelib for them defining the structure info used by IRecordInfo.
That said I'm not even sure the call works for public UDTs. You'd probably need to use SafeArrayCreateVectorEx() instead and figure out a clean way to fetch the IRecordInfo to pass to it.