Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 3
    If your overridden constructor isn't called, then it's a bug in your descendant class. That's a problem for the descendant-class developer to worry about, not you. And it IS possible to skip a call to AfterConstruction, for the same reason you can skip a call to the constructor: The descendant provides its own implementation and neglects to call the inherited method. Commented Apr 21, 2009 at 14:30
  • 3
    Rob: If you make a factory class, which generates TObject descendants, you cannot use TObject.Create() because it is not virtual! And if you make a TComponent descendant in your factory: it has a different constructor (Create(AOwner)). That's why you should use AfterConstruction: it is always called, no matter what kind of constructor Commented Apr 27, 2009 at 9:38