<div dir="ltr">Try TObjectList.</div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-15 1:02 GMT-03:00 Kiên Nguyễn Tiến Trung <span dir="ltr"><<a href="mailto:kc97ble@gmail.com" target="_blank">kc97ble@gmail.com</a>></span>:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thank you for your respond. I find that my real problem is more complex and need more help from you.<br><br></div><div>I want my TClass1 can contain many TClass2. It means that number of TClass2 in TClass1 is not fixed.<br><br></div><div>I've tried to use TComponentList, but it does not work. I knew that TCollection supports streaming, however, TClass1 and TClass2 must be TComponent.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2014-12-15 0:23 GMT+07:00 Howard Page-Clark <span dir="ltr"><<a href="mailto:hdpc@talktalk.net" target="_blank">hdpc@talktalk.net</a>></span>:</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><span>On 14/12/2014 12:23, Kiên Nguyễn Tiến Trung wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I am trying to streaming. I spent a lot of time but I didn't find the<br>
proper solution.<br>
<br>
I have two classes, TClass1, TClass2. Although the parent of AClass2 is<br>
AClass1, AClass2 isn't saved into specified file, only AClass1 is.<br>
</blockquote>
<br></span>
AClass1 is not the parent of AClass2. The two classes have no relationship, certainly not a hierarchical relationship.<br>
<br>
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).<br>
<br>
However, TClass1 and TClass2 are completely unrelated, and know nothing about each other's properties.<br>
Perhaps you are looking for something like the attached zipped unit1.pas.<br>
<br>
Howard<br>
<br>
<br>
<br>
<br>
<br>
---<br>
This email has been checked for viruses by Avast antivirus software.<br>
<a href="http://www.avast.com" target="_blank">http://www.avast.com</a><br>
<br></div></div><span class="HOEnZb"><font color="#888888">--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org" target="_blank">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
<br></font></span></blockquote></div></div>
<br>--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
<br></blockquote></div></div>