How can I create an Delphi object from a class reference and ensure constructor execution?

前端 未结 5 751
别那么骄傲
别那么骄傲 2020-12-01 04:26

How can I create an instance of an object using a class reference, and ensure that the constructor is executed?

In this code example, the constructor of TMyClass wi

5条回答
  •  死守一世寂寞
    2020-12-01 05:14

    You can create an abstract method in base class, and call it in the constructor, and override in child classes to be executed when created from class reference.

提交回复
热议问题