<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">Am 02.02.2018 17:53 schrieb "Dennis" <<a href="mailto:dec12@avidsoft.com.hk">dec12@avidsoft.com.hk</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have list of objects which contains references to other objects.<br>
I need to save all these objects to harddisk to be restored on a latter day.<br>
<br>
I know how to stream the data fields of these objects to a TFileStream but the tricky part is these how to restore the object references.<br>
<br>
The only way I can think of is to assign unique IDs to each objects and store these IDs to file.<br>
When these objects are later restored, I used these IDs find the actual objects and re-assign them back to the object references.<br>
<br>
It is tedious. Is there a smarter way?<br>
<br>
Also, there are some TNotifyEvent fields  e.g. OnClick, OnClose etc.  How do I save and restore them from file?<br>
<br>
Many thanks in advance.</blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">If your objects inherit from TComponent and you use published properties you can use the streaming screen of the RTL. </div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Sven </div></div>