Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting an interface from GetPropValue

I want to dynamically get a property value from an object instance. I was able to get the class properties, ordinal types and strings. The delphi source of the GetPropValue does not support tkInterface. Is there any way of getting the interface using the property info. BTW all the properties exposed are published properties.

for time being, i am using the TObject as the return type. GetPropValue returns the address of the object instance. I am typecasting that to TObject and returning the result.

like image 489
Rahul W Avatar asked Aug 25 '26 10:08

Rahul W


1 Answers

If I understand you right you want to use GetInterfaceProp() function. Usage is same as GetPropValue() but it returns an IInterface which you can "cast" to right type using ie Supports().

like image 137
ain Avatar answered Aug 28 '26 00:08

ain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!