hoff
asked on
save object
How save an object in Delphi ?
You can look at the way Delphi forms are saved. These are basically text files. If you put an image on your form and open a picture in it, when you save the form you'll see how it stores the picture inside the .DFM file.
You can store properties in INI files and inside the rigistry. Use TRegistry or something more inhanced for that. I think it can't store sufisticated objects though. I'm not sure and someone please correct me if I'm wrong.
You can store properties in INI files and inside the rigistry. Use TRegistry or something more inhanced for that. I think it can't store sufisticated objects though. I'm not sure and someone please correct me if I'm wrong.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Any descendant of the TPersistent object can use Delphis streaming services. Take a look at the online help of TPersistent. You will have to overwrite the DefineProperties to introduce special data to be read/written, published properties are handled automatically.
However, the easiest way is if your persistent object is contained in a component property. Then call ReadComponent/WriteCompone nt as viktornet proposed.
Slash/d003303
However, the easiest way is if your persistent object is contained in a component property. Then call ReadComponent/WriteCompone
Slash/d003303
Generally You must write code to save proprties which is needed for you.
Please tell us more, especially how you need to manipulate the saved objects and what objects you need to save.