Solved

Set the owner

Posted on 2004-10-10
3
263 Views
Last Modified: 2013-11-23
In my vcl I create a Tcollection alike:

constructor TgnCollection.Create(AOwner: TgnVCL);
begin
  inherited Create(TgnCollectionItem);
  FOwner := AOwner;
end;


How to sent my owner to TgnCollectionItem ???
0
Comment
Question by:ginsonic
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
LRHGuy earned 500 total points
ID: 12271164
When you create a collection item, you pass it the collection that it belongs to, like so:

C:=tCollection.Create;
I:=tCollectionItem.Create(C);

In effect, C is the owner of I.

If C has a property of Owner, then I can access that property with  I.Collection.Owner

Is that what you were looking for?
0
 
LVL 9

Author Comment

by:ginsonic
ID: 12271630
I was so close ;) I played with this but don't know whay first time don't work.

Thanks for support !
0
 
LVL 9

Author Comment

by:ginsonic
ID: 12271719
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 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

22 Experts available now in Live!

Get 1:1 Help Now