About Delphi .CFG Creator
=========================

NOTE: The first section of this file and additional Delphi tips are available at http://www.firstrain.com/cublea/delphi.html. Report any bugs in this 1.0 version to cublea@radiant.net.

This utility is a two-tier utility designed for both beginning Delphi developers and experienced pros. It is designed to generate a .CFG file for the DCC.EXE/DCC32.EXE command line Delphi compilers. Delphi does not come with setup utilities for the compilers and will not provide you with much help in setting up a .CFG.

So here's the big question...why would you even want to use these compilers? There are two main reasons for wanting command line compilation. Probably the biggest reason is for building demo projects and testing new components. Compiling from the command line is far, far faster than opening the IDE, loading a project and compiling it. And it is infinitely more convenient than installing new components just to test them. If a component comes with a demo project, you don't need to install the component to compile the demo project...*if* you compile with the command line compiler.

The problem is that you need a .CFG file or some fairly sophisticated batch scripting to run the command line compilers effectively, and how the hell do you build the .CFG?

That's where Delphi .CFG Creator comes in handy. It uses default values and known working syntax to build a .CFG for you, and install the .CFG in a fashion that makes drag-and-drop compiling outside the IDE a breeze. Expert Delphi users may observe that some redundant information is written to the .CFG. As we learn more about its absolute requirements, we'll take care of that in future versions of the applet, but for this version we erred on the side of completeness.

How to use the applet
=====================
First off, turn on Hints and Tips and wander around the interface until you get a feel for what the applet does. Each hint adds more info about the applet's purpose and how it all fits together.

Next, select the target platform for which you want to build a .CFG file (Delphi 1, 2 or 3). Information will be auto-filled for each version of the compiler in the four edit controls below. If you have special needs for the CFG, you can edit this information to suit the requirements of your project, but in most cases you can create and save the .CFG as soon as the fields have been filled. The .CFG-in-progress appears in the memo control so that you can perform manual editing as needed prior to saving it.

When the configuration is saved, a small stub program called DCCRUN.EXE (or, for Delphi 2 and 3, DCCRunD2.exe and DCCRunD3.exe) will be saved to the directory containing your command line compiler. This file is needed because a ShellExecute statement is required in order to set the working directory and get around path problems with drag-and-drop compiling of .DPRs when a desktop shortcut is installed. The ShellExecute solution conveniently allows you to avoid entering working directories and changing search paths every time you need to compile a project in a new directory. This small stub program will do nothing unless a .DPR is passed to it as a parameter, and it may not even be needed with some icon docks and menu programs with smart working-path handling. (One of our PCs uses Juan Aguirrebiria's 16-bit ToolBar icon dock, which does not require the runner stub.)

We strongly recommend installing some sort of drag-and-drop icon or shortcut for your saved .CFG, and setting up a .BAT file which includes a PAUSE statement so you can see compiler output and then close the DOS window with a single keypress. If you specify desktop shortcut creation, a DCC32.BAT batchfile will be created for you for Delphi 2 and 3 to force the console window to remain open. DCC.EXE uses "popup support", so it stays open anyway. A pausing batchfile or PIF with close-on-exit disabled is required to keep the compiler window from flashing open and shut before you can see any errors. The stub

Once you have a drop target installed on your icon dock or , you can drag .DPR files to the shortcut for instant compilation when the IDE is closed, or even when it's open.

Issues and known bugs
=====================
DCC.EXE, the 16 bit compiler, requires a .RES file for all VCL-based apps. The .RES file must use the same file prefix as the .DPR, but any 794-byte .RES file containing an icon will do in a pinch. Keep this in mind when attempting to compile 16 bit component demos which come without a .RES file.

DCC32.EXE will report an error if no .RES file exists for the project being compiled, but it will still compile the project.

Delphi 1's DCC.EXE has a known bug that results in the freezing of your mouse cursor in some circumstances. We have found this happens most often on our systems when Eudora is open at the time DCC.EXE is run.

When creating your own shortcuts and drop targets for DCC.EXE/DCC32.EXE or .BAT files, be sure that the PIF or LNK information does not point to a working directory. You'll have fewer snags when you allow the directory containing the .DPR to be used by Windows as the compiler's working directory, and that means leaving working directory fields blank.

Two-tier product
================
This basic version of Delphi .CFG Creator is freeware. Source is available only with the purchase of the pro version tool. (This tool is part of the Four Bit Tools series of utilities for programmers and serious computer users.)

The pro version of .CFG Creator includes additional options for refining the behavior of the compiler and provides source code for the interface as an optional "second tool" so that you can customize it to your own requirements. Anticipated release date for the pro version, which will not save .CFG files in its trial version form, is June 15, 1998. This standard version is and will remain free software since, to my knowledge, no tool of its kind currently exists for Delphi users.

