Wednesday, June 29, 2005

DCM: 2.1 beta available

The latest version Delphi Configuration Manager is now available. It is version 2.1 and is currently a public beta.

Why a beta? Simply because I am actually in europe for 6 weeks on holidays and will be unable to respond to queries as promptly as I would like to. This also means that the there is automated installation (there are instructions in the download) and the documentation is yet to be updated.

More information about the release is available from www.jed-software.com.

Expect a formal 2.1 release middle to late august. There is also time for any bugs found to be fixed. No major GUI changes will be done in the 2.x release of DCM though.

Thursday, June 09, 2005

The problem with "with"

Something that I strongly discourage Delphi developers from using is the with statement. I never used to dislike the with statement until I got burned pretty badly by a bug caused by the use of one.

You can't debug the with statement.
You can't watch a property if it's in a with block (check out my example), there is no tool tip evaluation for these properties either.

Small example showing the hazards of debugging a with statement.

1. Create a new win32 application (steps for D2005 - should be the same for all Delphi versions)
2. Add a button to the form
3. Create an OnCreate event
4. Add the following code:
   procedure TForm1.FormCreate(Sender: TObject);
   begin
       with Button1 do
          Caption := 'Hello';
   end;
5. Put a breakpoint on the with line and add Caption to the watch list.
6. Run the application and press the button.

Although it's probably better that the debugger doesn't cope with this as it might encourage more widespread use of with.

Perhaps the compiler should be enhanced to fulfil the request of this report in QualityCentral?

Defect No: 2667 Status: ReportedAdd ambiguous warnings to WITH statements
http://qc.borland.com/wc/wc.exe/details?ReportID=2667

One final thing before I end this post. The VCL is starting to get a large number of with statements added to it and it needs to stop. Especially in message handlers where you often see the following:

   with Message do
   begin
      // 30 lines of code here
   end;

The string "with Message do" was found 101 times in my D2005 VCL source. Think the 30 lines is an overstatement? Open up Forms.pas and check out the TCustomForm.WndProc method (it's over 100 lines).

This makes debugging a nightmare. If you debug the VCL often (as I do) and find this annoying, you may want to vote for the following QualityCentral report:
Defect No: 13515 Status: Reported
Remove all occurrences of the with statement from the VCL
http://qc.borland.com/wc/wc.exe/details?ReportID=13515

Looking for a QualityCentral win32 client?
Check out my QC Client - tentatively called JED, QC from http://www.jed-software.com/.
Want to beta test the soon to be released Version 1 (mega changes from the website version)? Send me an email requesting the download information (email on website).

Friday, June 03, 2005

DCM: Ah, the hope is gone :-)

http://qc.borland.com/wc/wc.exe/details?ReportID=10703

Incidently, this report is what DCM was initially created for (and will do very well eventually):

http://qc.borland.com/wc/wc.exe/details?ReportID=10702

A workaround for my Delphi IDE (or app) wont minimize

Sometimes the Delphi IDE will fail to minimize when the minimize button is selected from the caption bar. This generally seems to happen when you have used the "Show Desktop" functionality in Windows XP.

If your Delphi IDE is not minimizing, right click on the IDEs button in the Task Bar and select "Restore" (if enabled). You IDE should now minimize.

Note, this also happens in VCL applications and the workaround is also applicable.

Not sure if this is already known, just something I recently came across.

Thursday, June 02, 2005

DCM and the latest DevExpress Update

Developer Express has just released an update to their excellent VCL and VCL.NET components. Unfortunately the destination for the compiled packages has changed from the previous update and Delphi Configuration Manager doesn't cope too well with this (actually quite badly).

As I am just preparing the DCM update I am asking if any DevExpress users want to help in testing the update (I use DevExpress in the day job, but don't have access at home) please send me an email (address in the about box). Give me a day or so to get a solution written as well .

If you have already been using the beta release because of the Castalia issue, you will need to get this new beta as the Castalia update only has two lines of source code changed. The DCM update has several more .

Want a workaround that works for today... (it's not good).

1. Run DCM with the -refresh command line option (once)
2. Delete your configuration
3. Recreate your configuration

If you don't want to lose your settings then you have 2 choices, hold off from updating your DevExpress components, or email me for more specific steps.

I like that fact that all packages are now located in the one folder though. Hopefully other component vendors will follow.

thanks,