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


Create a delphi application from a dfm-file.

Posted on 2010-01-05
Medium Priority
Last Modified: 2012-05-08

Is it possible to create a delphi-application from a dfm-file.

Question by:peterkiers
  • 2
  • 2
LVL 13

Accepted Solution

rfwoolf earned 500 total points
ID: 26181967
Is this a delphi-generated dfm file?
View contain a list of objects and their properties on a form, and the names of procedures attached to events of objects on the form, but, they fail to give the procedures themselves, for that you use a .pas file (unit file).
In other words your dfm will give you an idea of what procedures you need and what the user sees, but  You will need to rewrite all the code.
LVL 13

Expert Comment

ID: 26181979
view =they
LVL 25

Assisted Solution

epasquier earned 500 total points
ID: 26182000
a dfm file contains all the components of a form with names and types, hieriarchy and parameters.
What you could do from only the dfm is recreate the form .pas file so that when you open it in the delphi IDE it would look the same as the original form, but you will have no event codes.

I don't think there is a tool to do so, but basically all you have to do is creating a new form, and in a standard text editor you add all components declaration in the first section of the form class (the one that is updated automatically by the IDE when you add components) to match all those that are in the dfm, but in a hierarchical way. Then you replace the automatically generated dfm with the old one, and open the modified .pas with the IDE

Author Comment

ID: 26182045

LVL 25

Expert Comment

ID: 26182066
about the events now, in the dfm they are linked with the functions like
OnCreate = FormCreate

You obviously don't have the FormCreate code. So if you leave these on...=... lines the IDE will complain.
Easiest way to move another step forward is to remove all these lines in the DFM file but with keeping elsewhere all events names and objects that triggers them, so that you can easily recreate the skelettons of these functions with the IDE by selecting all the related components manually and double click on each events.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month20 days, 13 hours left to enroll

864 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