Solved

Set the owner

Posted on 2004-10-10
3
267 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 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