Delphi: this version does not support command-line compiling (yes, it does)

There are a couple of rare cases where I do an automatic build of a Delphi application from a batch file. This uses the dcc32.exe command-line compiler. This worked great on one machine, but today it failed on another machine that had an identical setup. The error message was:

_PasCoreCompile: This version of the product does not support command line compiling.

2016-08-25_15-24-38

Lees meer over dit bericht

If you publish a WCF service using EF to IIS, do not forget to distribute sqlserver.dll manually

I’ve spent several hours this week debugging a WCF application using Entity Framework, that was published to an IIS server, only to have every call to the service fill with the error message “The type initializer for [My]DbContext has caused an exception”. Of course, on the dev machine everything was working fine. Short answer: as the blog title implies, the application was missing EntityFramework.SqlServer.dll in its bin folder, because Visual Studio failed to recognize the fact it is referenced by the application. Lees meer over dit bericht

Work faster in Delphi XE8 by using Castalia’s keyboard shortcuts

keys

The new Delphi XE8 includes Castalia for easier code navigation and refactorings. The Castalia refactorings however are still separate from the ‘native Delphi’ refactorings and they partly overlap in functionality. They both have their pros and cons. A definite pro for Castalia is that most of the refactorings can be done ‘inline’, that is, there is no modal dialog involved and some way or another, most of your changes can be done directly in your code editor.

Well, no dialogs is nice, but that only improves your productivity if you do not still need your mouse to trigger the refactoring. That means I have a couple of new keyboard shortcuts to start memorizing! Lees meer over dit bericht

Delphi XE8 released, introduces Package Manager

xe8-embarcadero-header

Earlier I wrote about the new Delphi roadmap and mentioned some features I considered interesting for the upcoming XE8 version. Today, Delphi XE8 was released and in the New Features list, another one caught my eye that I think is potentionally even more promising: the GetIt Package Manager. Every time a new Delphi version is released, there are two main reasons that block me from updating immediately as soon as it comes out: Lees meer over dit bericht

New Delphi roadmap shows IDE and VCL enhancements (next to all the iOS, Android and IoT goodies…)

Brian Alexakis has recently published Delphi XE7 icosome slides outlining the Delphi (and RAD studio) roadmap. I consider it very good news that, next to all the iOS, Android, Internet-of-things and other hot technologies, there are also some important VCL enhancements on there. Next to IDE feature and stability improvements, which are always nice of course. Take a look at slides 7-9.

One in particular that caught my eye was 4K display / Large font support, which I interpret as improvements to scaling of Delphi applications on hi-res displays. Though I don’t have a 4K monitor yet, I am the proud owner of a Microsoft Surface Pro 3 that features a high resolution display so any improvements on that front are more than welcome. It can look awful when done wrong.

In general, I consider it good to know that all of us long time Delphi developers that have existing (VCL) codebases to maintain (and extend and improve) are not left in the dark by Embarcadero, just in order to put another buzzword on the box of the next Delphi release. Keep it up!

Bad Delphi upgrade experience (that was partly my own fault)

Latest update (11:45): I finally managed to install Update 1. Though I still think the update experience is not as smooth as it could be (most of the points I mention below are still valid), and the error message I was getting was in no way related to what was actually wrong, the original fault was probably my own. I already mentioned that I moved the installation folder over to another drive using a junction point to reference it from its original location. Well, the moved folder was missing one quite important file (setup.exe). I must have missed it when moving the folder, I cannot think of another explanation. After copying it from the original XE7 ISO, and a reboot after the (now successful) uninstallation, XE7 Update 1 is currently installing in the background. Lees meer over dit bericht

Check your compiler warnings and hints. They may still be errors.

I try to follow a zero hints and warnings policy for my code. (I admit I don’t always succeed though. 😉 ) But I was initially confused on how to solve this, and because of that learned something about not always following directions blindly…

See this example code.

function Test: boolean;
var Something: TSomething;
begin
  Result := false;
  Something := TSomething.Create;
  try
    // Perform something that may raise an exception
    Result := true;
  finally
    FreeAndNil (Something);
  end;
end;

This function should return true if everything went ok, without exceptions, and false otherwise. You’ve probably at some point written something like that too. However, I get a compiler hint pointing to the first line of the function:

[dcc32] H2077 Value assigned to 'Test' never used.

I can make the hint go away by removing the first Result := false assignment. However, is my Result then guaranteed to initialize to false, as I would like it to? Lees meer over dit bericht