BaseClass TObject


Isn't the base class TObject just plain text, how can i get an example of the baseclass TObject?
And I try to find a picture in Delphi Help that displays the tree of all the classes.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TObject is defined in System.pas
this is D2007 declaration:

  TObject = class
    constructor Create;
    procedure Free;
    class function InitInstance(Instance: Pointer): TObject;
    procedure CleanupInstance;
    function ClassType: TClass;
    class function ClassName: ShortString;
    class function ClassNameIs(const Name: string): Boolean;
    class function ClassParent: TClass;
    class function ClassInfo: Pointer;
    class function InstanceSize: Longint;
    class function InheritsFrom(AClass: TClass): Boolean;
    class function MethodAddress(const Name: ShortString): Pointer;
    class function MethodName(Address: Pointer): ShortString;
    function FieldAddress(const Name: ShortString): Pointer;
    function GetInterface(const IID: TGUID; out Obj): Boolean;
    class function GetInterfaceEntry(const IID: TGUID): PInterfaceEntry;
    class function GetInterfaceTable: PInterfaceTable;
    function SafeCallException(ExceptObject: TObject;
      ExceptAddr: Pointer): HResult; virtual;
    procedure AfterConstruction; virtual;
    procedure BeforeDestruction; virtual;
    procedure Dispatch(var Message); virtual;
    procedure DefaultHandler(var Message); virtual;
    class function NewInstance: TObject; virtual;
    procedure FreeInstance; virtual;
    destructor Destroy; virtual;

>>And I try to find a picture in Delphi Help that displays the tree of all the classes.

I've seen it in some book about Delphi but it's not accessible from IDE however you can go to Menu -> View -> Structure (Shift + Alt + F11) to see tree with classes in current unit


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Russell LibbySoftware Engineer, Advisory Commented:
Object tree in PDF format, covers up to Delphi 5


peterkiersAuthor Commented:
I have a little difficulty to find out the diffirence between the term Object and Class? Can you explain it to me?

I think that TObject is a class: a collection of variabels, procedures and functions that belong together. But is not an object!

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

>>I think that TObject is a class

yes, TObject is class but class is not same as object. objects are instances of class

in other words:

  anobject: TObject;
  Panel1: TPanel;

TObject is class, but >>anobject<< is object (of class TObject)
TPanel is class, but Panel1 is object (of class TPanel)

A class is like a templace for an object.  Sort of like a cookie cutter is used to create cookies of a spcific shape.  A class defines what an object will be.  When you call TClass.Create you then create an instance of that class which is referred to as an object.  It goes from being a template of an object to actually being a object.  Does that make sense to you?
object is something that you can create and destroy (Panel1 := TPanel.Create(); Panel1.Free).
class is declaration how instances (instances  = objects of class) behave and what properties they have.

I wish I could explain it better but my english sucks:)

Russell LibbySoftware Engineer, Advisory Commented:
Yep, from the help file:

>> A class, or class type, defines a structure consisting of fields, methods, and properties. Instances of a class type are called objects. <<

Class is the definition, and an object is a created instance of that definition

peterkiersAuthor Commented:
Thanks for the info...


Peter Kiers
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.