Month: December 2008

Thread.Synchronize

No Picture

A general mistake many Delphi developers are making is accessing GUI classes from other threads directly (in a multi-threaded application). It’s a mistake I was doing for a long time. Eventually I started using SendMessage to synchronize with…

Read More »

FastMove: Optimizing System.Move

No Picture

This post describes a technique that can be used to optimize some RTL functions at run-time. At the end of the post there’s a unit; add it to your uses list (preferably as the first one) and the…

Read More »

Abstract methods (or “why not”)

No Picture

I always considered the implementation of abstract methods in Delphi to be a hack, mostly because there is no way (or is there?) to treat this: “[DCC Warning] W1020 Constructing instance of a class containing abstract method.” warning…

Read More »

Overridden method should match case of ancestor

No Picture

I’ve been following CodeRage III these days and presenter mentioned that in Delphi 7 (and above), when overriding virtual methods, the same case should be used for both functions. Consider this example: In this case indeed the compiler…

Read More »

Lock keyword (templates)

No Picture

This is a follow-up on the post about the “Lock keyword” emulation in Delphi. Just created 2 templates that you can use in your Delphi code to speed-up writing: [download#34] [download#35] Drop them into X:\Program Files\CodeGear\RAD Studio\6.0\ObjRepos\Code_Templates\Delphi directory…

Read More »

Strings in Delphi (continued)

No Picture

It seems the more you look, the more you find. There are a few interesting points in how strings are handled in Delphi; I’ve talked before about the particularities of String type in Delphi, so I’ll not touch…

Read More »

The Lock keyword

No Picture

What I miss the most from C# is the lock keyword. Unfortunately Delphi doesn’t (yet) have such a “feature” so we’re stuck making calls to synchronization objects manually. It’s not a big problem actually but can get quite…

Read More »

Delphi “Future”

No Picture

The title is probably a bit misleading. I’m not going to talk about the “future of Delphi” rather about the concept of “future evaluation” in Delphi. You might have heard about the Delphi Prism product that Embarcadero/CodeGear is…

Read More »