ranunez
asked on
Using a Object Property of an Object in a DLL
I have an Object in a DLL that contains other Objects. These are all created by me.
i.e.
Type
TMyObj = class (TObject)
private
FData: Integer;
public
construstor create;
destructor destory;
property MyInt read FData write FData;
end;
type
TMyOtherObj = class(TObject);
private
FObj: TObj;
public
constructor create;
destrustor destory;
property MyData read FObj write FObj;
end;
constructor TObj.create
begin
inherited create;
end;
destructor TObj.destoryl
inherited destroy;
end;
constructor TMyOtherObj.create
begin
inherited create;
FData.Create;
end;
destructor TMyOtherObj.destory;
begin
FData.free
inherited destroyl
end;
When I try to add data to the FData var it does not work.
What did I do wrong?
i.e.
Type
TMyObj = class (TObject)
private
FData: Integer;
public
construstor create;
destructor destory;
property MyInt read FData write FData;
end;
type
TMyOtherObj = class(TObject);
private
FObj: TObj;
public
constructor create;
destrustor destory;
property MyData read FObj write FObj;
end;
constructor TObj.create
begin
inherited create;
end;
destructor TObj.destoryl
inherited destroy;
end;
constructor TMyOtherObj.create
begin
inherited create;
FData.Create;
end;
destructor TMyOtherObj.destory;
begin
FData.free
inherited destroyl
end;
When I try to add data to the FData var it does not work.
What did I do wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ziolko.