Can we use RTTI to find functions/procedures by name and run them?
Asked Answered
S

1

8

As we can find a Property or an Object using RTTI, can we search for a certain function or procedure (not from an object as a method but from an unit) loaded in memory knowing just it's name?

And if we can, is it possible to execute it sending it's parameters?

Sexagesimal answered 5/8, 2013 at 8:35 Comment(0)
I
5

Delphi's RTTI system is based around types. However, procedures and functions with unit scope are not associated with types and so cannot be reached using RTTI.

Inoperative answered 5/8, 2013 at 8:43 Comment(2)
@SirRufo showed me: docwiki.embarcadero.com/CodeExamples/XE3/en/…. So, the only way is to create those function inside objects for me to 'invoke' them?Sexagesimal
You can also retrieve the method parameters by RTTI theroadtodelphi.wordpress.com/2010/10/10/…Wadewadell

© 2022 - 2024 — McMap. All rights reserved.