On Sat, 15 Oct 2022, Hairy Pixels wrote:



On Oct 15, 2022, at 3:03 PM, Michael Van Canneyt <[email protected]> wrote:

as far as I kbow, this should be
ObjectArray := TObjectArray(GetDynArrayProp(AObject, PropertyInfo));
i.e. you get the actual array as a result.


You’re right, I didn’t need that pointer cast. I’m still curious though why 
that didn’t work. Shouldn’t the pointer still just point to the dynamic array 
address and basically do nothing?

No, it's perfectly logical what is happening. You can't cast a type (TA) to a pointer to that type (^PTA) and expect the compiler to automagically forget the
extra dereference when you dereference it...

Michael.
_______________________________________________
fpc-pascal maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to