Try TObjectList.
2014-12-15 1:02 GMT-03:00 Kiên Nguyễn Tiến Trung kc97...@gmail.com:
Thank you for your respond. I find that my real problem is more complex
and need more help from you.
I want my TClass1 can contain many TClass2. It means that number of
TClass2 in TClass1 is not fixed.
I've tried to use TComponentList, but it does not work. I knew that
TCollection supports streaming, however, TClass1 and TClass2 must be
TComponent.
2014-12-15 0:23 GMT+07:00 Howard Page-Clark h...@talktalk.net:
On 14/12/2014 12:23, Kiên Nguyễn Tiến Trung wrote:
I am trying to streaming. I spent a lot of time but I didn't find the
proper solution.
I have two classes, TClass1, TClass2. Although the parent of AClass2 is
AClass1, AClass2 isn't saved into specified file, only AClass1 is.
AClass1 is not the parent of AClass2. The two classes have no
relationship, certainly not a hierarchical relationship.
You make AClass1 the *owner* (not the *ancestor*) of AClass2 for that
single instantiation in your program (i.e. responsible for correctly
freeing the instance).
However, TClass1 and TClass2 are completely unrelated, and know nothing
about each other's properties.
Perhaps you are looking for something like the attached zipped unit1.pas.
Howard
---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus