How can I create a Delphi program without VCL components?

How can I create a Delphi program without VCL components?


This code is pretty useless, but is meant to demonstrate that youdo not need to use the VCL to create Windows programs. This really showsDelphi’s Object Pascal roots.

So how do you write something like this?Well, it’s all in the project file. For the most part, you’ll rarely needto go into it; however, the project file is where the application executesand where all your forms that are visible at runtime are created. In essence,the DPR file is a Pascal program file that acts as the equivalent to the’main’ section of a C program.

To get into the Project source file, select View | Project Source fromthe menu, and the project file will be opened in the editor. It’s thateasy!

Hopefully, this will give you ideas of what you can do. Here’sa hint: Using just a project file, you can create totally form-lessapplications that can run completely in the background.

All you have to do is open this projectfile from the IDE, then compile and run it.

{================================================================================ Project Name : SaveIt.DPR Program Name : SaveIt.EXE Written by : Brendan V. Delumpa  Date Created : November 2, 1995 Description  : This is a simple utility that performs a Save As to a different                directory. Notice that it's completely independent of a form.                Just compile this program and run it. The initial directory will                be the directory from where this program is run. Usage        : SaveIt  Reference    : Look under help under TSaveDialog to change any of theparameters ================================================================================}program Saveit;uses Forms, Dialogs, SysUtils;{$R *.RES}var  SaveDlg : TSaveDialog;begin  SaveDlg := TSaveDialog.Create(Application);  with SaveDlg do  begin    InitialDir := ExtractFilePath(ParamStr(0));    FileName   := ParamStr(1);    Title   := '[' + ParamStr(1) + ']-Save File As';    Filter  := 'Valid Files|*.DBF;*.CSV;*.WKS;*.XLS';    Options := [ofFileMustExist, ofOverwritePrompt, ofPathMustExist];    Execute;    Free;  end;end.
Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may