Tuesday, January 04, 2005

A lean mean Delphi machine

If you're using Delphi 2005 and you're not using custom registry configurations you're doing a lot of unnecessary waiting around for features to load that you aren't going to use. For instance if you're working on a Win32 project, you really don't want to be loading the ECO packages. Also some of the Delphi 2005 features are a little immature and preventing their packages from loading can improve the IDE stability immensely.

Custom registry configurations are an undocumented feature of Delphi that unbeknownst to us all have been available from Delphi 6 onwards. Corbin Dunn from Borland has probably provided the most detail about this useful feature. His instructions involve modifying the registry directly with RegEdit which can be a risky affair if you inadvertently delete the wrong keys.

I've been working with Erwien Saputra and together we've put together a utility that makes it easy and safe to create these custom configurations. It works by copying either your base configuration or another custom configuration and then lets you modify the new configuration safely.

Key to creating these custom configurations is knowing which packages and assemblies are required for which style of development. I've put together an article discussing the different Delphi 2005 packages and how they relate to Win32 VCL development. It's the first article in a series I'm working on. Subsequent articles will discuss the packages needed for VCL.NET, Winforms, ECO, C#, ASP.NET with Delphi, ASP.NET with C# etc. There's lots of gaps in my knowledge of these packages though so I'd love any feedback you can provide on their functions.

CodeSite 2 can work in Delphi 2005

If you're a user of Raize Software's CodeSite debugging tool, you might have received the same shock I did when going to the Raize site to download an update for Delphi 2005. CodeSite 3 was released a few months ago and there is no official support for using CodeSite 2 in Delphi 2005.

The upgrade price for CodeSite 3 is quite hefty and hard for me to justify right now. CodeSite 3 looks impressive but I only use a fraction of the features of CodeSite 2 and I don't think that's going to change any time soon.

I've was pondering what to do about this when I realised that the source code for the runtime packages was provided with CodeSite 2, it's only the design time packages that source wasn't provided for.

A quick copy and update of the old runtime packages to Delphi 2005 format proved this to be correct. I can now make full use of CodeSite 2 through source code in Delphi 2005. The CodeSite components are not available but I rarely used them and all they do is save you typing a few lines of code anyway.

To get CodeSite 2 running in Delphi 2005.

  1. You need to already own a copy of CodeSite 2. This won't work otherwise.
  2. Save this updated CodeSite 2 package for Delphi 2005 in your CodeSite2\Source folder.
  3. Open it in Delphi 2005 and choose "Delphi for Win32" when asked what the package type is.
  4. Compile the package.
  5. I recommend you create a CodeSite2\Lib9 folder similar to the CodeSite folders for the other compilers. Copy the csintf.dcu, CSP20I90.dcp and CSP20I90.dcu files into it.
  6. I also recommend you copy the CSP20I90.bpl package into C:\WinNT\System32 alongside the other CodeSite 2 runtime packages.
  7. Lastly you'll need to add CodeSite2\Lib9 to your Delphi 2005 Library Path.

After that's done you should be able to use the csintf unit in your Delphi 2005 Win32 projects like you could in Delphi 7. If you need .NET support though you'll need to purchase CodeSite 3. From past experience CodeSite 3 is quite likely a fantastic product, it's just more than I need right now.

Monday, January 03, 2005

Customising Delphi 2005 Help

I think it was just coincidental but a few days after I reintegrated the IntraWeb help into the Delphi 2005 IDE, the Delphi help on my PC imploded and wouldn't load the indexes for any help files.

It may have been caused by me running the Delphi setup again but I don't really know. Anyway if it happens to you here's the fix and also a way to customise the help system to remove help files you don't need.

  1. Open a command prompt and change the directory to $(BDS)\Help\Common.

  2. Unregister the help files with this command

    regHelp -7

  3. To reregister all help files again use this command

    regHelp 7

    If you wanted to be more selective with the help files that are registered you could try this instead which registers only the common help files and the Win32 help files.

    regHelp 5

    To register the common help files and the .NET help files only use this command

    regHelp 3

What do those numbers mean?

The numbers are made by adding up the values from the table below. To install you use a positive value and to uninstall you use a negative one.

Common1
.NET2
Win324

For example to install just the common and Win32 help files the parameter would be 5 made up from 1 + 4 (Common + Win32). To uninstall them the value would be -5.

To see all the options available enter regHelp with no parameters at the command prompt.

Saturday, January 01, 2005

No Intraweb help in Delphi 2005

You might have noticed that there's no Intraweb help available in Delphi 2005 when you press F1. The help files are there inside \Help\ThirdParty, they just don't seem to be incorporated into the IDE help system. From the newsgroups I found a way to integrate it back into the IDE help. I can't explain the reasoning behind this but it fixed the problem for me.

  1. Open $(BDS)\Help\ThirdParty\IntraWeb.HxC inside Notepad

  2. Change the line

    <!DOCTYPE HelpCollection SYSTEM "MS-Help://Hx/Resources/HelpCollection.DTD">

    to

    <!DOCTYPE HelpCollection>

  3. Open a command prompt and change the directory to

    $(BDS}\Help\ThirdParty

  4. Enter the command

    h2reg -u

  5. Enter the command

    h2reg -r -m

You should then be able to get context sensitive help for IntraWeb types. It doesn't appear in the contents but I'm not sure if that's by design or another bug.

One simply must have a second blog

Welcome to my programming blog. I'm going to focus mainly on programming with Delphi since that's what I know best but I'll diverge onto other topics and languages occasionally.

You've probably arrived here via my first blog Lachlan Gemmell - Software Startup. I like to keep that blog very focused and on topic so I've created this second blog for anything that doesn't quite fit over there.

I'll probably do a bit more linking here than at my other blog but I won't be echoing all the other Delphi blogs out there. I hate reading the same news six times over from six different blogs and I'm sure you do too. So I'll just play it by ear for a while and see how things turn out.

Thanks for dropping by,

Lachlan