Solved

Using a Object Property of an Object in a DLL

Posted on 2007-03-19
3
149 Views
Last Modified: 2010-04-05
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?
0
Comment
Question by:ranunez
  • 3
3 Comments
 
LVL 21

Accepted Solution

by:
ziolko earned 500 total points
ID: 18748878
constructor TMyOtherObj.create
begin
   inherited create;
   FData := TObj.Create;
end;


ziolko.
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18798621
any luck?
ziolko.
0
 
LVL 21

Assisted Solution

by:ziolko
ziolko earned 500 total points
ID: 18798624
of course should be:
constructor TMyOtherObj.create
begin
   inherited create;
   FObj := TObj.Create;
end;

ziolko.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now