[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

DFM <----> Text File

Posted on 1998-12-10
4
Medium Priority
?
543 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 320 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month18 days, 6 hours left to enroll

830 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