1. About.com
  2. Computing & Technology
  3. Delphi

Threading and Thread Pools Made Easy!

Threading in Delphi

The time has come for you to start implementing multi-threaded code in your Delphi applications? To speed up some parts of the application you might want to decide to add several simultaneous paths of execution in your Delphi application.

Threading 101
Delphi Spotlight10

Ensure NO #13#10 Ending When Using TStringList.SaveToFile

Tuesday January 24, 2012
in TStringList :: The SaveToFile method of the TStringList class adds an empty line to the file. Here's how to remove that extra line (actually CRLF - #13#10) in your Delphi applications you need one line of text to really be one line of text in the saved document.

Read the full article to learn how to Remove Empty Line Added With TStringList.SaveToFile

Related:

Deactivating the TShellTreeView Delphi Control - Faking the Active Property

Monday January 23, 2012
in Shell Controls :: Delphi's TShellTreeView component displays a hierarchical tree view of the system's shell folders and files.
I have an application using TShellTreeView with otFolders and otNonFolders set for ObjectTypes. The actual shell tree is, by design, not visible, and is only presented to the user when actually needed.

When the form hosting the shelltreeview is created, the TShellTreeView will read the shell structure and populate the tree. Note that the component is not visible by default - therefore not "needed" at form creation. The process of enumerating the shell as done by the component takes some time (a few seconds) and it appears as is the application has frozen.

Read the full article to learn how to Fake a Non Existing Active Property for a TShellTreeView

Related:

Real World: Upgrade From Turbo Delphi .Net To ?

Tuesday January 17, 2012
in Real World Issues :: I've received an interesting email recently from a long time Pascal/Delphi user Jacques Brits.

Jacques has an interesting problem to solve, I guess many could have, and was asking to help him pick the correct direction. Here's a section of the email:


I suspect you might be the man to point me in the right direction.

I am the architect-developer of engineering software called GWIS, a hydraulic pipe network simulator.

Development started back in the days of Turbo Pascal and later Borland Pascal with Objects. When XP was released the DOS software could only display graphics in 640x480 VGA mode. Like everyone else, I was forced to port the software to the Windows platform.

Being a fan of Anders Hejlsberg and hearing all the hype about .NET, I chose to use Delphi 8 for .NET for the port. The port was completed with Turbo Delphi for .NET as a Windows Forms application. No VCL.NET, all Winforms.

Of course this turned out to be a dumb move, as I found out with CodeGear RAD studio 2009's Delphi for .NET.

Although it could compile my code, I could no longer visually edit my Winforms in the design Tab. To edit forms, I had to use Turbo Delphi on a WinXP machine and then copy the .resx files. I was forced to move on to RAD studio 2009, as Turbo Delphi could not install on Windows 7.

I recently got Delphi XE2, only to find that the DelphiDotNet personality is no longer supported !?

My questions:

  1. Is there an easy way out, apart from changing all the forms to VCL or Firemonkey ?
  2. If not, sould I opt for VCL or Firemonkey ?
  3. Do you know of a way to install Turbo Delphi on Windows 7 ?

Seems like a complicated situation, as always is the case in real world problems a developer has to solve.

My answer was "If you want to stick to Net I guess your only move would be to try Delphi Prism. Here's what should help in order to install Turbo on Windows 7. As for VCL or Firemonkey - hard one to answer, that is, pick the right direction."

What say you? Are you in the same situation, or you were, or you might be? What would you suggest?

Ignoring the "Variable 'btn' might not have been initialized" Warning? Do NOT!

Friday January 13, 2012
in Pointers & Delphi :: Take a look at your Delphi application, the one you are developing for many days (weeks, years) ... when you hit Compile - how many compiler warnings do you see? Zero? Bravo! A few? A dozen, hundreds? Do you find in the list the "Variable 'btn' might not have been initialized" warning? Are you ignoring it? You should not!

Read the full article to learn why you should Be Aware Of Uninitialized Variables

Related:

Discuss in my forum

©2012 About.com. All rights reserved. 

A part of The New York Times Company.