The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Posts Tagged ‘Delphi’

Laurensvanrun/Delphi-Promises: Delphi implementation of promises for asynchronous programming.

Posted by jpluimers on 2025/03/19

On my research list after making this short note April 2024: [Wayback/Archive] GitHub – Laurensvanrun/Delphi-Promises: Delphi implementation of promises for asynchronous programming.

My first impression is that this might be on the same level of usefulness and influention as these two:

Notes:

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Development, EKON, Event, ITDevCon, Software Development | Tagged: , | Leave a Comment »

Delphi XE8 things I learned from the first week of G+ reading

Posted by jpluimers on 2015/04/15

Components and tools that work with XE8:

Appmethod

--jeroen

Posted in Castalia, Delphi, Delphi XE8, Development, Software Development | Tagged: , , , | 3 Comments »

Delphi XE7 is out with version 21.0.17017.3725; Spring4D is almost ready.

Posted by jpluimers on 2014/09/04

Remarkably few people note the actual version number of the Delphi releases, though that is the version mentioned in any QC reports.

Now that Delphi Insider: Download links for Delphi XE7, C++Builder XE7 and RAD Studio XE7 are there, the ftpd and altd have been seeded a few days ago with the version time stamped at the end of last month, here is the version number:

QC version number for Delphi XE7: 21.0.17017.3725 (Update 1 has version 21.0.17707.5020).

I got that number from the first XE7 report in QC posted almost 2 months ago (and verified it against other reports), so it seems XE7 has undergone some serious testing.

Before installing, note that in addition to the below documentation links:

Be sure to have at least 60 gigabytes of free disk space before you attempt to install.

This in addition to the 5 gigabyte ISO file (:

XE7 doc links

Spring4D

On the Spring4D side (yes, it has a new logo!), Stefan has added XE7 support, so a new release of that is near.

–jeroen

Posted in Delphi, Delphi XE7, Development, QC, Software Development | Tagged: , | 1 Comment »

Delphi and C++ Builder VCL Library Buffer Overflow

Posted by jpluimers on 2014/08/19

Since this did not make it to DelphiFeeds yet: I’ve seen the function PaletteFromDIBColorTable in Graphics.pas go back as far at least until Delphi 2006, and references on the web as far back as Delphi 4.

So: this bug is old, but as it is a security one, make sure you patch soon.

For Delphi XE6, download 29913 BMP Buffer Overflow hotfix – Delphi, C++Builder, RAD Studio XE6.

For older Delphi versions, read this piece that was adapted from the EDN article Delphi and C++ Builder VCL Library Buffer Overflow:

For users of prior versions of Delphi and C++Builder: these steps should be followed to modify the VCL source code and add it to your application.

For each application:

  1. Add the modified Edit Vcl.Graphics.pas or Graphics.pas or Borland.Vcl.Graphics.pas to your project
  2. For C++Builder: Under Project | Options | Packages | Runtime Packages, set “Link with runtime packages” to false
  3. Rebuild your application

Once for the native VCL and .NET VCL:

  • Note: Variable names and scoping might be slightly different depending on your product version.
  1. Edit Vcl.Graphics.pas or Graphics.pas or Borland.Vcl.Graphics.pas
  2. Locate the function PaletteFromDIBColorTable.
  3. Add the following code just before the line assigning a value to Pal.palNumEntries when the DIBHandle = 0
    if ColorCount > 256 then 
      InvalidGraphic{$IFNDEF CLR}@{$ENDIF}SInvalidBitmap;;

–jeroen

via Delphi and C++ Builder VCL Library Buffer Overflow.

Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | Tagged: , , , | 5 Comments »

Optimizing Delphi build speeds (via; Vin Colgin – Google+; IDE FixPack; DelphiSpeedUp, Microsoft KBs with speed fixes)

Posted by jpluimers on 2014/03/23

An interesting thread by Vin Colgin – Google+ – IDE FixPack 5.4.1 shows 36.5% increase in BUILD speed under….

The post and discussion covers these topics:

–jeroen

Posted in Delphi, Delphi 2007, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Tagged: , | 9 Comments »

Hidden Features in Delphi related topics (from StackOverflow, until the diamond moderators kill these too)

Posted by jpluimers on 2014/02/20

There are (soon probably “were”) a few very interesting Q&A threads on Stack Overflow in the “Hidden Secrets of” series on Delphi related topics.

I sort of can get (but don’t agree: there is a very good voting system to de-emphasize material that is not useful, but who am I to argue with the minority of “the world is black and white, we just follow the rules” diamondss) that these get closed, but cannot get that very useful material gets deleted for anyone with less than 10-thousand reputation.

–jeroen

@Jeroen & David, I’ve deleted my off-topic comments from here. Could you do the same, please ? I’ve also asked moderators to delete my meta question as it seems the users there are not even humans. Never mind. Stack Overflow is not what it was few years ago as I observe. It’s getting worse. Another piece to this mosaic was running the portuguese version of Stack Overflow ideal for cross posting between the sites.

Posted in Delphi, Development, Software Development | Tagged: | 8 Comments »

Delphi: the Factory Pattern with virtual Create Constructors (via: What Design Patterns do you implement in common Delphi programming? – Stack Overflow)

Posted by jpluimers on 2014/02/20

Delphi Component Design

Delphi Component Design

From long ago, but still very valid, as I recently had another question like “what design patterns does Delphi use?”.

The Delphi usage of patterns to make the VCL and your applications work is one of the reasons I like the Delphi Component Design: Danny Thorpe so much.
Do not let you scare by the book title: a lot of information in this book is much broader than designing components.
It is about why and how things are done in the RTL and VCL, and which patterns you can use yourself.

Try and git it while you can still get it. It is excellent, but rare to get as it has been out of print for a while.

Only a minority of the Delphi developers knows that every Delphi developer uses a Factory pattern (delphi.about.com has an example in “regular” Delphi), but then implemented using virtual Create constructors.

So: time to shed some light on that :-)

Virtual constructors are to classes like virtual methods are like object instances.

The whole idea of the factory pattern is that you decouple the logic that determines what kind (in this case “class”) of thing (in this case “object instance”) to create from the actual creation.

It works like this using virtual Create constructors:

TComponent has a virtual Create constructor so, which can be overridden by any descending class:

type
  TComponent = class(TPersistent, ...)
    constructor Create(AOwner: TComponent); virtual;
    ...
  end;

For instance the TDirectoryListBox.Create constructor overrides it:

type
  TDirectoryListBox = class(...)
    constructor Create(AOwner: TComponent); override;
    ...
  end;

You can store a class reference (the class analogy to an object instance reference) in a variable of type ‘class type’. For component classes, there is a predefined type TComponentClass in the Classes unit:

type
  TComponentClass = class of TComponent;

When you have a variable (or parameter) of type TComponentClass, you can do polymorphic construction, which is very very similar to the factory pattern:

var
  ClassToCreate: TComponentClass;

...

procedure SomeMethodInSomeUnit;
begin
  ClassToCreate := TButton;
end;

...

procedure AnotherMethodInAnotherUnit;
var
  CreatedComponent: TComponent;
begin
  CreatedComponent := ClassToCreate.Create(Application);
  ...
end;

The Delphi RTL uses this for instance here:

Result := TComponentClass(FindClass(ReadStr)).Create(nil);

and here:

// create another instance of this kind of grid
SubGrid := TCustomDBGrid(TComponentClass(Self.ClassType).Create(Self));

The first use in the Delphi RTL is how the whole creation process works of forms, datamodules, frames and components that are being read from a DFM file.

The form (datamodule/frame/…) classes actually have a (published) list of components that are on the form (datamodule/frame/…). That list includes for each component the instance name and the class reference.
When reading the DFM files, the Delphi RTL then:

  1. finds about the components instance name,
  2. uses that name to find the underlying class reference,
  3. then uses the class reference to dynamically create the correct object

A regular Delphi developer usually never sees that happen, but without it, the whole Delphi RAD experience would not exist.

Allen Bauer (the Chief Scientist at Embarcadero), wrote a short blog article about this topic as well.
There is also a SO question about where virtual constructors are being used.

Let me know if that was enough light on the virtual Create constructor topic :-)

–jeroen via: What Design Patterns do you implement in common Delphi programming? – Stack Overflow.

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Tagged: , | 4 Comments »

Don’t forget to register: RAD-in-Action Webinar Unit Testing in Delphi featuring Nick Hodges

Posted by jpluimers on 2014/02/12

Do not forget to register for the RAD-in-Action Webinar Unit Testing in Delphi featuring Nick Hodges.

If you cannot watch it live: register anyway, as that will give you the URL for the replay download.

Very interesting stuff (I attended his sessions during the German EKON Conference) and a very entertaining speaker.

He is going to cover a lot in this seminar, and it is a great addition to the material in his Coding in Delphi book (Warren Postma wrote a nice review). You get the electronic edition of the book free when you have Delphi XE5, a hard-copy should be available soon. Read the rest of this entry »

Posted in Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Tagged: , , | 1 Comment »

Delphi XE5 Update 2 got released last week, end-of-year Delphi XE5 offer, #CodingInDelphi book

Posted by jpluimers on 2013/12/19

Just around the start of the Delphi XE5 end-of-year special offer (more details below), Delphi XE5 Update 2 was released (for geeks: version 19.0.13856.4978). It adds C++ Builder for iOS support, and fixes many bugs.

What I like most is that the majority of XE5 Update 2 bugfixes are not FireMonkey related.

It indicates the Delphi team puts a lot of effort in the classic Delphi stuff, where still a lot of Delphi users earn their money.

Since Delphi XE5 Update 2 is a re-install, the best is to download the ISO image which – like the updates for PAServer for Mac (ftpd) and PAServer for Windows (ftpd) – is on both the altd and ftpd server.

XE5 promotion offers

Best of all: you get RAD Studio XE5, Delphi XE5, or C++Builder XE5  (: Read the rest of this entry »

Posted in Delphi, Delphi XE5, Development, Software Development | Tagged: , | 7 Comments »

Delphi XE3/XE4: removing empty .VLB files; XE5 update 2 and special offers are out. #codingindelphi

Posted by jpluimers on 2013/12/19

Even when not using Visual Live Binding, Delphi generates empty .VLB files in both Delphi XE3 (virtually always) and Delphi XE4 (most of the time).

Visual Live Binding is one way of binding data to UI in FireMonkey and can also be used in VCL, but does not have to (Alister Christie made a nice video ▶ Delphi Training Tutorial #77 – Visual Live Bindings – YouTube about it).

Empty VLB files, and a batch file to delete them

The “empty” VLB files are almost empty, as they are exactly 3 bytes long and contain the byte sequence EF BB BF which is the Unicode BOM (byte order mark) for the UTF-8 encoding. Read the rest of this entry »

Posted in Delphi, Delphi XE3, Delphi XE4, Delphi XE5, Development, Encoding, QC, Software Development, Unicode, UTF-8, UTF8 | Tagged: , | Leave a Comment »