Invoking Methods

Not only does the new extended RTTI lets you access values and fields, but it also provides a simplified way for calling methods. In this case you have to define a TValue element for each parameter of the method. There is a global

Invoke function which you can call for executing a method:

function Invoke(CodeAddress: Pointer; const Args: TArray<TVa1ue>; CallingConvention: TCallConv; AResultType: PTypelnfo): TValue;

As a better alternative, there is a simplified Invoke overloaded method in the

TRttiMethod class:

function Invoke(Instance: TObject;

0 0

Post a comment

  • Receive news updates via email from this site