Being totaly new in Delphi, I have the following problem:
I would like to create my own class (MyClass) and include on it some delphi
Component.
TMyClass = Class (?) file://What should I use for ancestor
DataBase: TDatabase;
DataSource: TDataSource
Table: TTable;
end;
var
MyClass: TMyClass
I instance my variable (MyClass:= TMyCLass.Create(self) ) and then, when I
try to access the DataBase objet, an exception is raise (access violation).
Should I instance DataBase too ? How ?
I'm making this in a unit without a form in it.
Thank you for your help.
David l...@bluewin.ch
>I instance my variable (MyClass:= TMyCLass.Create(self) ) and then, when I
>try to access the DataBase objet, an exception is raise (access violation).
>
overide the create constructor of mycomponent and create those other
components in it.
Constructor.Create(Aowner:tcomponent);override;
Constructor.Create(Aowner:tcomponent);
Begin
Database := Tdatabase.Create(Self);...
End;
Don't forget to destroy all that in the destroy method