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

Archive for the ‘Delphi 2007’ Category

Delphi installs: cleaning up space from %ProgramData%

Posted by jpluimers on 2015/09/16

A while ago I asked this on G+:

I’ve a VM with many Delphi versions and want to clean up space from %ProgramData% to install more. I think somewhere in the comments it was mentioned what to delete from %ProgramData% to lessen the disk space used by Delphi installations. […]

The VM is on an SSD, and the GUID directories there total to about 50 gigabytes.So any reminder what I can delete there would be much appreciated (:

Besides saving disk space, another advantage is that you get far less duplicates when indexing your filesystem with Everything: the directories contain copies of all files also present in the final installation (like %ProgramFiles%, etc).

Thanks to Ilya S, below are my notes for cleaning up a machine that has Delphi 2007 and Delphi 2010-XE6 installed.

In these folders, backup delete all subdirectories but the directory OFFLINE. Don’t delete files. Keep the backups in case you need them.

Read the rest of this entry »

Posted in Delphi, Delphi 2007, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | 3 Comments »

Delphi: rolling your own code or (dis)trusting the libraries that ship with Delphi?

Posted by jpluimers on 2015/09/09

Over the two decades I’ve come across a lot of Delphi projects.

All of them have one thing in common: even for functionality available in the Delphi libraries, much of that code was self-written.

You even see this in big libraries that have shipped with Delphi bit not originate from the Delphi team. Take Indy: lots of “roll your own” in it.

I’ve made some thoughts about that, and see these main causes with the points below.

What’s your thought on this?

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Delphi 10 Seattle, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Event, QC, Software Development | 1 Comment »

Rudy’s Delphi Corner – Pitfalls of converting, on converting from C/C++ to Delphi

Posted by jpluimers on 2015/09/02

If ever in need to translate C/C++ headers or code to Delphi, this refernece by Rudy Velthuis – a dentist with a strong interest in programming – is the best I could find: Rudy’s Delphi Corner – Pitfalls of converting.

It is written in a pretty version agnostic way, and covers the vast majority of conversion topics.

And it has been updated over time numerous times.

–jeroen

Posted in Borland C++, C, C++, C++ Builder, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 10 Comments »

GoF Patterns in Delphi | Implementations of the famous Gang of Four Design Patterns in Delphi language – via Nick Hodges

Posted by jpluimers on 2015/08/20

Thanks to Nick Hodges for having Delphi-losophy | Flotsam and Jetsam #88 point me to GoF Patterns in Delphi | Implementations of the famous Gang of Four Design Patterns in Delphi language.

–jeroen

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 2 Comments »

Installing FireDAC 8 for Delpi 2007

Posted by jpluimers on 2015/08/19

Installing FireDAC 8 for Delpi 2007

Installation

  1. Obtain 29458_firedac_xe4_update_2_for_rad_studio_delphi_c_ent_ult_arch.zip from a registered Delphi XE4 or higher license: http://cc.embarcadero.com/item/29458:
  2. Extract it into FireDAC_8.0.5.3365.exe.
  3. Run FireDAC_8.0.5.3365.exe with the /showide parameter as described in http://support.embarcadero.com/article/42970:
  4. FireDAC_8.0.5.3365.exe /showide
    1. (When not running as Administrator: elevate to Administrator)
    2. Welcome screen: press next
    3. License screen: accept, then press next
    4. Destination selection screen: keep C:\Program Files (x86)\Embarcadero\FireDAC, then press next
    5. Select components screen: keep the selection (Full installation), then press next
    6. Select IDEs screen: choose Delphi 2007 (but not Delphi 2006), then press next
    7. Select Demo Databases screen: keep the settings (do not choose Interbase / Firebird server as then you have to provide the credentials for the server), then press next
    8. Start menu screen: keep Embarcadero FireDAC, then press next
    9. Ready to install screen: press install
    10. After installation: press finish, then read the readme
      1. or later browse to <file:///C:/Program%20Files%20(x86)/Embarcadero/FireDAC/Readme.html>
      2. That’s what actually tells you:

The installer automatically installs FireDAC in the Delphi XE4 and C++ Builder XE4 IDEs. For older versions of the IDEs, you can run the installer with the /SHOWIDE command line parameter.

After installation

To fix this when starting Delphi:

[Window Title]
Error

[Content]
Can't load package C:\Users\Public\Documents\RAD Studio\5.0\Bpl\AnyDAC_Dcl_D11.bpl.
The specified module could not be found.
Do you want to attempt to load this package the next time a project is loaded?

[Yes] [No]

The actual BPL sometimes is in C:\Users\<username>\AppData\Local\Documents\RAD Studio\5.0\Bpl\AnyDAC_Dcl_D11.bpl

The cause is that the BPL gets loaded from %BDSCOMMONDIR% which on some systems points to

  • %PUBLIC%\Documents\RAD Studio\5.0

and on others points to

  • %LOCALAPPDATA%\Documents\RAD Studio\5.0

This seems to be the case on machines where more different Windows users are using Delphi.

The installer does not fully recognize this distinction, so copies the BPL to %LOCALAPPDATA%\Documents\RAD Studio\5.0\Bpl and registers it as being in %PUBLIC%\Documents\RAD Studio\5.0\Bpl.

On these machines there is a difference between the definition of BDSCOMMONDIR in these registry keys:

  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
    • points to C:\Users\Public\Documents\RAD Studio\5.0
  • HKEY_CURRENT_USER\Environment
    • points to C:\Users\<username>\AppData\Local\Documents\RAD Studio\5.0

Solution

reg delete "HKCU\Software\Borland\BDS\5.0\Known Packages" /v "%PUBLIC%\Documents\RAD Studio\5.0\Bpl\AnyDAC_Dcl_D11.bpl" /f
reg add "HKCU\Software\Borland\BDS\5.0\Known Packages" /v "%BDSCOMMONDIR%\Bpl\AnyDAC_Dcl_D11.bpl" /t REG_SZ /d "Embarcadero FireDAC Components" /f

–jeroen

via: jeroenp / BeSharp.net / source / Native / Delphi / Documentation / Install-FireDAC-8-in-Delphi-2007.md — Bitbucket.

Posted in Delphi, Delphi 2007, Delphi XE4, Development, Software Development | 4 Comments »

Fuzzing in addition to Unit Tests – via: David Millington G+

Posted by jpluimers on 2015/08/11

I need to give this link from Jonathan Lange which was shared by David Millington some thought:

Embedded in Academia : How to Fuzz an ADT Implementation.

There they add fuzzers to help testing an ADT: in this case an Abstract Data Type in the form of  a red-black tree.

And then see if it can be added to DUnit and NUnit or MSTest/VSTest in some way.

In the original post by Jonathan Lange, an important remark was made by Eric Castelijn:

… the downside being that having non deterministic tests means having test failures that are hard to repeat

When fuzzing multiple or composite values, the chances that you will hit interesting edge cases semi-reliably will drop dramatically, in my experience

–jeroen

via “This post has two points. First, you should write ADT fuzzers. It is often….

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »

Delphi: turn off column or line block selection mode – via: Default IDE Shortcut Keys; Delphi Programming

Posted by jpluimers on 2015/07/30

The Default IDE Shortcut Keys – Delphi Programming was a good starting point to find out how to disable column or line blocks.

Since the table there is incomplete (even the Embarcadero documentation is wrong as some shortcuts can turn on and off a mode), here are the relevant shortcuts keys:

Ctrl + O + C Turns on/off blockcolumn selection mode Delphi 5 and up
Ctrl + O + K Turns on/off block selection mode Delphi 5 and up
Ctrl + O + L Selects current line (and turns off block selection mode) Delphi 5 and up

This is especially useful when the block selection is stuck (this happens every now and then: it’s a known bug).

–jeroen

Posted in Delphi, Delphi 10 Seattle, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 6 Comments »

20 resources on migrating to Unicode with Delphi | Software on a String

Posted by jpluimers on 2015/07/08

Great post by Marjan Venema when you need to migrate your old Delphi programs to the modern Delphi world: [Wayback] 20 resources on migrating to Unicode with Delphi | Software on a String.

I’m glad that some of the links overlap with what I posted and presented in the past at:

Well done Marjan!

–jeroen

Posted in Ansi, ASCII, Delphi, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Encoding, Software Development, Unicode | Leave a Comment »

On the Delphi TCommandParser class for parsing command-lines and arguments (via: Suggestions for how to define command line parameters – Stack Overflow)

Posted by jpluimers on 2015/05/13

A while ago, I posted [WayBack] the below StackOverflow answer. Recently a friend asked me about command-line parsing in Delphi, so here is the re-run:

Delphi contains a really nice unit called CommandParser with a [WayBack] TCommandParser class that does commandline parsing for you. Since it has [WayBack] virtually no documentation, here are a few things to get started. It works even in Delphi 2007.

I have a HiddenExecutable example at our open source bo repository.

Basically you:

  • TComponent that contains the properties you want to expose as commandline parameters (that is THiddenExecuteSettings in the HiddenExecuteSettingsUnit
  • a commandline parser controller. In our case THiddenExecuteArguments in theTHiddenExecuteArgumentsUnit (in retrospect not such a good name) that contains an InitCommandLine method that sets up a TCommandParser instance passing it your TComponent
  • It then executes a couple of [WayBack] AddSwitch calls to setup the parameters with both abbreviated and full commandline switches (like h and help)
  • ProcessCommandLine method on the TCommandParser instance to process the commandline and fill the properties of your TComponent (in my example, this is done in the ProcessCommandLine method).

Now comes the fun:

  • TCommandParser has a HelpText method that fully automatically assembles a helptext based upon what you fed it with the AddSwitch methods.
  • TCommandParser also has a SaveOptions method that allows you to save the current settings of your TComponent into a settings file.

The Delphi units you need are these which you can get from the Embarcadero [WayBack] radstudiodemos.sourceforge.net demo repository:

CommandParser in '...\radstudiodemos.sourceforge.net\branches\RadStudio_XE2\Delphi\Database\dbExpress\Utils\CommandParser.pas',
PropertyHelpers in '...\radstudiodemos.sourceforge.net\branches\RadStudio_XE2\Delphi\Database\dbExpress\DbxDataPump\PropertyHelpers.pas',
ParseIds in '...\radstudiodemos.sourceforge.net\branches\RadStudio_XE2\Delphi\Database\dbExpress\DbxDataPump\ParseIds.pas',

Edit: [WayBack] John Kaster wrote a nice [WayBack] article on EDN that includes [WayBack] more details on using the TCommandParser.

Note the above mentioned code mostly is on [WayBack] https://bitbucket.org/jeroenp/wiert.me/src/tip/Native/Delphi/Apps/Console/HiddenExecuteConsoleProject

Since Delphi XE7, this unit does not ship with Delphi any more, but it is still at [WayBack] RAD Studio Demo Code / Code / [r2029] /branches/RadStudio_XE6/Object Pascal/Database/dbExpress/Utils/CommandParser.pas.

–jeroen

via: [WayBack] delphi – Suggestions for how to define command line parameters – Stack Overflow.

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 4 Comments »

Delphi Component vendors: when you ship source code, make it IDE-browsable as well by compiling with $YD or $Y+

Posted by jpluimers on 2015/05/06

It took me a while to figure this one out:

When you have a registered Delphi, you can Ctrl-Click browse both the units and symbols of RTL, VCL, etc. But Delphi will not recompile these units.

Some third party components you cannot Ctrl-Click browse the units or symbols, unless you put the source directory in the Delphi Library Path (which causes them to be compiled each and every time).

This is because:

  • the precompiled DCUs are in the Delphi Library Path.
  • the source code is added to the Delphi Browsing Path (and sometimes not even that).
  • the DCUs don’t contain information that the source code is Browsable or Referencable as it was compiled with {$Y-}.

These are the possible values for that directive:

  1. {$Y-} or {$DEFINITIONINFO OFF} or {$REFERENCEINFO OFF},
  2. {$Y+} or{$REFERENCEINFO ON},
  3. {$YD} or {DEFINITIONINFO ON}

So please component vendors: when you ship source code, make it IDE-browsable as well by compiling with $YD or $Y+.

–jeroen

via:

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | 2 Comments »