Solved

DFM <----> Text File

Posted on 1998-12-10
4
533 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi component that can load a DLL in design time? 8 64
Intraweb download file link ? 1 134
Dev Express grid collapse 2 45
Convert MS Word document to a PDF file 9 82
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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