Questions tagged [delphi]

Delphi is a language for rapid development of native Windows, macOS, Linux, iOS, and Android applications through use of Object Pascal. The name refers to the Delphi language as well as its libraries, compiler and IDE which is used to help edit and debug Delphi projects.

Delphi is a general-purpose language for rapid development of native Windows, OS X, Linux, iOS, and Android applications.

The name used to refer to the Delphi language, but the developers decided to return to the languages original name Object Pascal, restraining the name to the IDE, which is used to help edit and debug Delphi projects more efficiently. It is developed by Embarcadero, and is sold either as a standalone product or as part of RAD Studio, which includes other languages as well.

Delphi is an enhancement of Niklaus Wirth's language Pascal (and Object Pascal).

Delphi originated in 1995 at Borland, evolving from Turbo Pascal. It is currently owned by Embarcadero, and is the second-largest Windows development platform after Microsoft's .NET.

Among Delphi's strengths are:

  • consistent language architecture
  • a fast compiler
  • modern language constructs
  • its extensive Visual Component Library (VCL)
  • the associated visual form designer

Variants:

Some other Embarcadero products are or were released using the "Delphi" brand. A .NET product called Delphi Prism (based on PascalScript codebase) for use in MS Visual Studio allows for development using Mono, producing apps that are "cross platform" in that they will run on multiple platforms that support Mono. Delphi Prism is mostly compatible with Delphi syntax, albeit with very different libraries. The Embarcadero PHP product, formerly labelled "Delphi for PHP", and Prism are integrated in the main Embarcadero studio project RAD Studio. There is an AS/400 version of Delphi as well.

Delphi console "Hello world":

program Hello;
{$APPTYPE CONSOLE}
begin
  Writeln('Hello, World');
end.

A minimalist GUI Delphi application

program GUIHello;
uses  
  Windows;
begin
  MessageBox(0, 'Message', 'Hello, World', MB_OK);
end.

Resources:

Many SO profiles of Delphi developers point to good resources concerning Delphi. There is also an aggregation of main blogs in the field at DelphiFeeds and Begin End. Marco Cantù's books on Delphi programming provide another great resource.

Documentation

See all questions around delphi here.

References

Tagging recommendation:

There are several version-specific tags. It is recommended to use the tag together with the version-specific tag, e.g. .

Free Delphi/Pascal Programming Books

Delphi/Pascal Books

Reporting bugs, issues, new features

Delphi Forums

51211 questions
41
votes
9 answers

How to detect true Windows version?

I know I can call the GetVersionEx Win32 API function to retrieve Windows version. In most cases returned value reflects the version of my Windows, but sometimes that is not so. If a user runs my application under the compatibility layer, then…
gabr
  • 26,580
  • 9
  • 75
  • 141
41
votes
4 answers

Delphi: Understanding constructors

i'm looking to understand virtual override overload reintroduce when applied to object constructors. Every time i randomly add keywords until the compiler shuts up - and (after 12 years of developing with Delphi) i'd rather know what i'm doing,…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
41
votes
6 answers

Antivirus False positive in my executable

I just ran into an annoying problem. Suddenly Avira AntiVir started to flag one executable from my software as being a virus. As the default action from almost any user is to click OK and Avira suggests to put the virus in quarantine, most of my…
Ricardo Acras
  • 35,784
  • 16
  • 71
  • 112
41
votes
4 answers

Delphi - Why does ExplicitWidth and ExplicitHeight keep appearing in .DFM files and what is it?

We've noticed that when checking in updates, our .DFM files have added ExplicitWidth and ExplicitHeight properties - but we don't know why. My questions are: What are these properties for? Why are they automatically added by Delphi? Below is an…
Pauk
  • 2,623
  • 3
  • 26
  • 28
41
votes
4 answers

Delphi UUID generator

Does Delphi have anything built-in to generate UUIDs?
Cruachan
  • 15,733
  • 5
  • 59
  • 112
40
votes
4 answers

Delphi: Prompt for UAC elevation when needed

We need to change some settings to the HKEY_LOCAL_MACHINE at runtime. Is it possible to prompt for uac elevation if needed at runtime, or do I have to launch a second elevated process to do 'the dirty work'?
Vegar
  • 12,828
  • 16
  • 85
  • 151
40
votes
10 answers

Conversion between absolute and relative paths in Delphi

Are there standard functions to perform absolute <--> relative path conversion in Delphi? For example: 'Base' path is 'C:\Projects\Project1\' Relative path is '..\Shared\somefile.pas' Absolute path is 'C:\Projects\Shared\somefile.pas' I am looking…
kludg
  • 27,213
  • 5
  • 67
  • 118
40
votes
2 answers

Is it possible to write extensions to Delphi's debugger?

I know there's an API for creating extensions to Delphi. I use the GExperts package and various JVCL experts frequently. But I've never seen any extensions to the debugger. It would be very nice, for example, to be able to register viewers for…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
40
votes
29 answers

Which embedded database to use in a Delphi application?

I am creating a desktop app in Delphi and plan to use an embedded database. I've started the project using SQlite3 with the DISQLite3 library. It works but documentation seems a bit light. I recently found Firebird (yes I've been out of Windows…
Darrel
  • 563
  • 1
  • 5
  • 9
40
votes
7 answers

How to determine Delphi Application Version

Want to obtain Delphi Application build number and post into title bar
Link Wilson
  • 417
  • 1
  • 4
  • 3
40
votes
4 answers

How do I make a PNG resource?

I've got a form with a large TImage on it as a background. Problem is, this is stored directly in the DFM as a bitmap, which takes up about 3 MB. The original PNG file is ~250K. I'd like to try to reduce bloat by embedding the PNG in a resource,…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
39
votes
7 answers

System Error. Code: 8. Not enough storage is available to process this command

We have a few Win32 applications (coded in Delphi 2006) where sometimes the user gets an error message saying "System Error. Code: 8. Not enough storage is available to process this command.". From the stacktrace it looks like it is always during…
Marius
  • 2,494
  • 6
  • 31
  • 41
39
votes
2 answers

How to diagnose COM-callable wrapper object creation failure?

I am creating a COM object (from native code) using CoCreateInstance: const CLASS_GP2010: TGUID = "{DC55D96D-2D44-4697-9165-25D790DD8593}"; hr = CoCreateInstance(CLASS_GP2010, nil, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, IUnknown, out…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
39
votes
6 answers

Using Case Statement with String

Say i have a string 'SomeName' and wanted the values return in a case statement. Can this bedone? Can strings be used in a case statement like so Case 'SomeName' of 'bobby' : 2; 'tommy' :19; 'somename' :4000; else …
Glen Morse
  • 2,437
  • 8
  • 51
  • 102
38
votes
1 answer

Is there a trick for using TSQLMonitor with a TSQLConnection that uses the new ODBC dbExpress driver?

I have been testing the new ODBC dbExpress driver that ships with Delphi XE2, and have noticed that the TSQLMonitor does not seem to work. Thinking that I may have configured the component incorrectly, I hooked up a TSQLMonitor to a TSQLConnection…
Cary Jensen
  • 3,751
  • 3
  • 32
  • 55