The Visual Component Hierarchy

Remember from Chapter 2 that the abstract class TObject is the base class from which all classes descend (see Figures 10.1 and 10.2).

As a component writer, you don't descend your components directly from TObject. The VCL already has TObject class descendants from which your new components can be derived. These existing classes provide much of the functionality you require for your own components. Only when you create noncomponent classes do your classes descend from TObject.

TObject's Create() and Destroy() methods are responsible for allocating and deallocating memory for an object instance. In fact, the TObject.Create() constructor returns a reference to the object being created. TObject has several functions ...

Get Borland® Delphi™ 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.