[Lazarus] Fwd: Need help in streaming components

Kiên Nguyễn Tiến Trung kc97ble at gmail.com
Mon Dec 15 05:02:17 CET 2014


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 <hdpc at 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 at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141215/a57a406d/attachment-0003.html>


More information about the Lazarus mailing list