Delphi Learn About The Application’s InitInstance Method

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,203
Credits
4,034
Learn About The Application’s InitInstance Method
By Muhammad Azizul Hakim September 22, 2021

InitInstance or DelphiVCL.Application.InitInstance method is used to initialize a newly allocated object instance to all zeros and initializes the instance’s virtual method table pointer.

How to use the InitInstance Method properly?​

You should not call InitInstance directly. InitInstance is called by NewInstance when an object is created. When overriding NewInstance, be sure to call InitInstance as the last statement.

InitInstance is not virtual, so you cannot override it. Instead, initialize any data for an object in the constructor.

Let’s browse all the properties, methods, and built-in properties of the DelphiVCL.Application.InitInstance using dir() command:
Python:
import DelphiVCL
 
dir(DelphiVCL.Application.InitInstance)
See the responses in our Windows command prompt:
1632307971747.png
You can also read short information about the DelphiVCL.Application.InitInstance using the print() command:
Python:
print(DelphiVCL.Application.InitInstance)
print(DelphiVCL.Application.InitInstance.__doc__)
See the responses in our Windows command prompt:
1632308003398.png