The Files Produced by the System

The Files Produced by the System

Delphi produces various files for each project, and you should know what they are and how they are named. Basically, two elements have an impact on how files are named: the names you give to a project and its units, and the predefined file extensions used by Delphi. Table 1.1 lists the extensions of the files you'll find in the directory where a Delphi project resides. The table also shows when or under what circumstances these files are created and their importance for future compilations.

Table 1.1: Delphi Project File Extensions


File Type and Description

Creation Time

Required to Compile?


Bitmap, icon, and cursor files: standard Windows files used to store bitmapped images.

Development: Image Editor

Usually not, but they might be needed at run time and for further editing.


Borland Project Group: the files used by the new multiple-target Project Manager. It is a sort of makefile.


Required to recompile all the projects of the group at once.


Borland Package Library: a DLL including VCL components to be used by the Delphi environment at design time or by applications at run time. (These files used a .DPL extension in Delphi 3.)

Compilation: Linking

You'll distribute packages to other Delphi developers and, optionally, to endusers.


The Microsoft Cabinet compressed-file format used for web deployment by Delphi. A CAB file can store multiple compressed files.


Distributed to users.


Configuration file with project options. Similar to the DOF files.


Required only if special compiler options have been set.


Delphi Compiled Package: a file with symbol information for the code that was compiled into the package. It doesn't include compiled code, which is stored in DCU files or in the BPL file.


Required when you use run-timepackages. You'll distribute it only to other developers along with BPL files. You can compile an application with the units from a package just by having theDCP file and the BPL (and no DCU files).


Delphi Compiled Unit: the result of the compilation of a Pascal file.


Only if the source code is not available. DCU files for the units you write are an intermediate step, so they make compilation faster.


The Delphi Diagram Portfolio, used by the Diagram view of the editor (was .DTI in Delphi 5)


No. This file stores "design-time only" information, not required by the resulting program but very important for the programmer.


Delphi Form File: a binary file with the description of the properties of a form (or a data module) and of the components it contains.


Yes. Every form is stored in both a PAS and a DFM file.


Backup of Delphi Form File (DFM).


No. This file is produced when you save a new version of the unit related to the form and the form file along with it.


Support file for the Integrated Translation Environment (there is one DFN file for each form and each target language).

Development (ITE)

Yes (for ITE). These files contain the translated strings that you edit in the Translation Manager.


Dynamic link library: another version of an executable file.

Compilation: Linking

See .EXE.


Delphi Option File: a text file with the current settings for the project options.


Required only if special compiler options have been set.

.DPK and now also .DPKW and .DPKL

Delphi Package: the project source code file of a package (ora specific project file for Windows or Linux).




Delphi Project file. (This file actually contains Pascal sourcecode.)




Backup of the Delphi Project file(.DPR).


No. This file is generated auto-matically when you save a new version of a project file.


Desktop file: contains infor-mation about the position of the Delphi windows, the files open in the editor, and other Desktop settings.


No. You should actually delete it if you copy the project to a new directory.


Delphi Symbol Module: stores all the browser symbol information.

Compilation (but only if the Save Symbols option is set)

No. Object Browser uses this file, instead of the data in memory, when you cannot recompile a project.


Executable file: the Windows application you've produced.

Compilation: Linking

No. This is the file you'll distribute. It includes all of the compiled units, forms, and resources.


Or .HTML, for Hypertext Markup Language: the file format used forInternet web pages.

Web deployment of an ActiveForm

No. This is not involved in the project compilation.


The license files related to an OCX file.

ActiveX Wizard and other tools

No. It is required to use the control in another development environment.


Object (compiled) file, typical of the C/C++ world.

Intermediate compilation step, generally not used in Delphi

It might be required to merge Delphi with C++ compiled code ina single project.


OLE Control Extension: a special version of a DLL, containing ActiveX controls or forms.

Compilation: Linking

See .EXE.


Pascal file: the source code of aPascal unit, either a unit related to a form or a stand-alone unit.




Backup of the Pascal file (.PAS).


No. This file is generated automatically by Delphi when you save a new version of the source code.


Resource file: the binary file associated with the project and usually containing its icon. You can add other files of this type to a project. When you create custom resource files you might use also the textual format, .RC.

Development Options dialog box. The ITE (Integrated Translation Environment) gene-rates resource files with special comments.

Yes. The main RES file of an application is rebuilt by Delphi according to the information in the Application page of the Project Options dialog box.


Translation Repository (part of the Integrated Translation Environment).

Development (ITE)

No. Required to manage the translations.


Type Library: a file built automatically or by the Type Library Editor for OLE server applications.


This is a file other OLE programs might need.


To-do list file, holding the items related to the entire project.


No. This file hosts notes for the programmers.


Microsoft Data Link.


Used by ADO to refer to a data provider. Similar to an alias in the BDE world (see Chapter 12).

Besides the files generated during the development of a project in Delphi, many others are generated and used by the IDE itself. In Table 1.2, I've provided a short list of extensions worth knowing about. Most of these files are in proprietary and undocumented formats, so there is little you can do with them.

Table 1.2: Selected Delphi IDE Customization File Extensions


File Type


Delphi code templates.


Delphi's Object Repository. (The repository should be modified with the Tools ® Repository command.)


Delphi menu templates.


Database Explorer information.


Delphi edit mask (files with country-specific formats for edit masks).


Delphi component templates.


Desktop settings file (one for each desktop setting you've defined).

Looking at Source Code Files

I've just listed some files related to the development of a Delphi application, but I want to spend a little time covering their actual format. The fundamental Delphi files are Pascal source code files, which are plain ASCII text files. The bold, italic, and colored text you see in the editor depends on syntax highlighting, but it isn't saved with the file. It is worth noting that there is a single file for the form's whole code, not just small code fragments.


In the listings in this book, I've matched the bold syntax highlighting of the editor for keywords and the italic for strings and comments.

For a form, the Pascal file contains the form class declaration and the source code of the event handlers. The values of the properties you set in the Object Inspector are stored in a separate form description file (with a .DFM extension). The only exception is the Name property, which is used in the form declaration to refer to the components of the form.

The DFM file is by default a text representation of the form, but it can also be saved in a binary Windows Resource format. You can set the format you want to use for new projects in the Designer page of the Environment Options dialog box, and you can toggle the format of individual forms with the Text DFM command on a form's shortcut menu. A plain-text editor can read only the text version. However, you can load DFM files of both types in the Delphi editor, which will, if necessary, first convert them into a textual description. The simplest way to open the textual description of a form (whatever the format) is to select the View As Text command on the shortcut menu in the Form Designer. This command closes the form, saving it if necessary, and opens the DFM file in the editor. You can later go back to the form using the View As Form command on the shortcut menu in the editor window.

You can edit the textual description of a form, although you should do so with extreme care. As soon as you save the file, it will be parsed to regenerate the form. If you've made incorrect changes, compilation will stop with an error message; you'll need to correct the contents of your DFM file before you can reopen the form. For this reason, you shouldn't try to change the textual description of a form manually until you have good knowledge of Delphi programming.


In the book, I often show you excerpts of DFM files. In most of these excerpts, I show only the relevant components or properties; generally, I have removed the positional properties, the binary values, and other lines providing little useful information.

In addition to the two files describing the form (PAS and DFM), a third file is vital for rebuilding the application: the Delphi project file (DPR), which is another Pascal source code file. This file is built automatically, and you seldom need to change it manually. You can see this file with the Project ® View Source menu command.

Some of the other, less relevant files produced by the IDE use the structure of Windows INI files, in which each section is indicated by a name enclosed in square brackets. For example, this is a fragment of an option file (DOF):


The same structure is used by the Desktop files (DSK), which store the status of the Delphi IDE for the specific project, listing the position of each window. Here is a small excerpt:


Part I: Foundations