Table of Contents
What is the Purpose of DelphiVCL.Application.MethodAddress?
In this post, you’ll learn more about MethodAddress or DelphiVCL.Application.MethodAddress method returns the address of a class method by name.
Note: You can use MethodAddress for published methods only.
Learning more about the MethodAddress method will help you easily build a Python project in the future with Delphi VCL Applications.
How to use DelphiVCL.Application.MethodAddress in Delphi?
To give some sense of how to use this method in Python, let’s learn about how to use it in Delphi.
Here is an easy way to invoke the method is to define a procedure or function data type, such as:
1 |
type TProc = procedure of object; |
Assign the object name and the MethodAddress method to a TMethod variable, such as:
1 2 |
MethodVar.Data := Pointer(ObjectInstanceName); MethodVar.Code := ObjectInstanceName.MethodAddress('MethodNameString'); |
Pass this in a call to a variable of the procedure or function type:
1 2 |
Proc := TProc(MethodVar); Proc; |
How to browse the properties, methods, and built-in properties of the DelphiVCL.Application.MethodAddress?
Let’s browse all the properties, methods, and built-in properties of the DelphiVCL.Application.MethodAddress using dir() command:
1 2 3 |
import DelphiVCL dir(DelphiVCL.Application.MethodAddress) |
See the responses in our Windows command prompt:
You can also read short information about the DelphiVCL.Application.MethodAddress using the print() command:
1 2 |
print(DelphiVCL.Application.MethodAddress) print(DelphiVCL.Application.MethodAddress.__doc__) |
See the responses in our Windows command prompt:
Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.