Solved

DFM <----> Text File

Posted on 1998-12-10
4
530 Views
Last Modified: 2010-04-04
Hi All !!!

Please, is here nay way to comvert DFM file to Text file or 'enum' DFM file in runtime ?

Thanx !

Ps: something line View As Form (alt F12) in Delphi...
0
Comment
Question by:rayofunreal
  • 2
4 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 1350303
HI Ray,

Link in the FMXUtils unit in your Delphi/Demos/Doc/FilManex.
Then try this

procedure TForm1.Button1Click(Sender: TObject);
begin
  ExecuteFile('convert.exe', 'unit2.dfm unit2.txt', 'c:\Program Files\Borland\Delphi 3\Bin', SW_SHOW);
end;

Should work the other way around too(just unit2.text ubit2.dfm in the params)

PS. SW_Show can be SW_HIDE.
Hope this helps
br(UINT)je.
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1350304
I don't need to RUN external program....

I need some like this:

DFM2TXT('c:\proj.dfm',Memo1.Text);

is it possible with example you wrote ?
0
 
LVL 10

Accepted Solution

by:
Jacco earned 80 total points
ID: 1350305
This should work!

procedure DfmToText(InName: String; OutName: String);
var
  InStream: TFileStream;
  OutStream: TFileStream;
begin
  InStream:=TFileStream.Create(InName,fmOpenRead);
  OutStream:=TFileStream.Create(OutName,fmCreate);
  ObjectResourceToText(InStream,OutStream);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  DfmToText('c:\Test.dfm','c:\Test.txt');
end;

Regards Jacco.
0
 
LVL 1

Author Comment

by:rayofunreal
ID: 1350306
I'll try it ! thanx !
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now