[DUG] Storing extra data with a component

Todd Martin toddm at kol.co.nz
Fri Jun 10 10:32:32 NZST 2005


Hi Phil

The Delphi streaming system can only recreate TComponents from the stream. 
All other published (TPersistent) properties must be created independently, 
i.e. by their parent object.
How will descending your TCollection class help?

Todd.


----- Original Message ----- 
From: "Phil Scadden" <p.scadden at gns.cri.nz>
To: "NZ Borland Developers Group - Delphi List" <delphi at ns3.123.co.nz>
Sent: Thursday, June 09, 2005 4:27 PM
Subject: Re: [DUG] Storing extra data with a component


>> TMyComponent = class(TComponent)
>> published
>>   property Collection:TCollection;
>> end;
>>
>> as long as Collection is actually a TOwnedCollection with self as the
>> owner and it is a published property
>> then the TReader & TWriter of Delphis streaming will stream the data.
>
> Hmm, works well enough to write the component but no go on reading it
> because there is nothing which tells the component what descendent
> of TOwnedCollection is in the stream; no way for it create the appropriate
> type. Looks like I will have to descend the class.
>
> ----------------------------------------------------------
> Phil Scadden, Institute of Geological and Nuclear Sciences
> 764 Cumberland St, Private Bag 1930, Dunedin, New Zealand
> Ph +64 3 4799663, fax +64 3 477 5232
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
> 



-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.5.1 - Release Date: 2/06/2005



More information about the Delphi mailing list