TObject Class Summary

As a summary104, this is the complete interface of the TObject class in Delphi 2009 (notice the different string data types used):

type

TObject = class constructor Create; procedure Free;

class function InitInstance(lnstance: Pointer):

TObject; procedure Cleanuplnstance; function ClassType: TClass; inline; class function ClassName: string; class function ClassNamels(const Name: string): Boolean;

class function ClassParent: TClass; class function Classlnfo: Pointer; class function InstanceSize: Longint; inline; class function InheritsFrom(AClass: TClass): Boolean; class function MethodAddress(

const Name: ShortString): Pointer; overload; class function MethodAddress(const Name: string):

Pointer; overload; class function MethodName(Address: Pointer): string; function Fie1dAddress(const Name: ShortString):

Pointer; overload; function Fie1dAddress(const Name: string):

Pointer; overload; function GetInterface(const IID: TGUID; out Obj): Boolean;

class function GetInterfaceEntry(const IID: TGUID):

PInterfaceEntry; class function GetInterfaceTable: PInterfaceTable; class function UnitName: string; function Equa1s(Obj: TObject): Boolean; virtual; function GetHashCode: Integer; virtual; function ToString: string; virtual; function SafeCa1lException(ExceptObject: TObject;

ExceptAddr: Pointer): HResult; virtual; procedure AfterConstruction; virtual; procedure BeforeDestruction; virtual;

104 Another set of changes affects the internal layout of the class reference data in Delphi 2009. For example, the vmtParent location was -36 in previous versions, but is -48 in Delphi 2009. If you use the symbolic vmt entries, your code will compile unchanged, but if you used the equivalent numeric locations you'll likely get into trouble.

procedure Dispatch(var Message); virtual; procedure DefaultHandler(var Message); virtual; class function Newlnstance: TObject; virtual; procedure Freelnstance; virtual; destructor Destroy; virtual; end;

Overloaded methods like MethodAddress and FieldAddress can take either a UnicodeString (UTF-16, as usual) or a ShortString parameter that is treated as a UTF-8 string. In fact, the versions taking a plain Unicode string, convert them by calling the function UTF8EncodeToShortString:

function TObject.FieldAddress( const Name: string): Pointer; begi n

Result := FieldAddress(UTF8EncodeToShortString(Name)); end;

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment