Board index » delphi » Saving / Loading a *.DFM or Component to a Database

Saving / Loading a *.DFM or Component to a Database

I'm trying to save a DFM or Component file to a datbase and read it back
in. I'm trying
to use the Stream class so far I've not been able to successfully read the
*.DFM back in .I know this can be done. Anyone have sample code or ideas

--
Please reply to DKu...@WitSys.comNOWAY

Please remove NOWAY

 

Re:Saving / Loading a *.DFM or Component to a Database


Quote
Doug Kurtz wrote in message <01bd6a08$94941fe0$4604010a@dkurtz>...
>I'm trying to save a DFM or Component file to a datbase and read it back
>in. I'm trying
>to use the Stream class so far I've not been able to successfully read the
>*.DFM back in .I know this can be done. Anyone have sample code or ideas

You can use the ObjectResourceToText function to convert the stream to text,
and store it as text.

--
Yorai Aminov
El-On Software Systems, Ltd.
http://ourworld.compuserve.com/homepages/yaminov

Re:Saving / Loading a *.DFM or Component to a Database


Quote
>You can use the ObjectResourceToText function to convert the stream to
text,
>and store it as text.

This brings me another question:

The DFM files are in Binary format. Can I open them to text format w/o the
Delphi IDE (having my Delphi program do the binary conversion the IDE does)
?

Alex S. Abreu

Re:Saving / Loading a *.DFM or Component to a Database


Quote
Alex Simonetti wrote in message <6h7t6k$bc...@forums.borland.com>...
>The DFM files are in Binary format. Can I open them to text format w/o the
>Delphi IDE (having my Delphi program do the binary conversion the IDE does)

Yes, using the same function. Create a TFileStream and open the DFM file.
Create a TMemoryStream and call ObjectResourceToText to copy the text into
the memory stream. Call the memory stream's Seek method to place the current
pointer to the start of the stream. Create a TStringList object and call the
LoadFromStream method to load the contents of the memory stream. You now
have the textual representation of the DFM in your TStringList object.

--
Yorai Aminov
El-On Software Systems, Ltd.
http://ourworld.compuserve.com/homepages/yaminov

Other Threads