- Free PDF Library for Delphi Developers - Quick PDF Library LITE
- MSBuild and Delphi compiler hints – binary patch
- Join Embarcadero for Free Webinar on Delivering Reports Using FastReport and RAD Studio XE 2
- Delphi Mapping REST Clients
- Switch Languages / Keyboard Layouts in Your Delphi Application
- Visualizing physics using FireMonkey
- Delphi 17th Birthday Webinar Coming
- RAD Studio XE2 in Action Live in Italy
- It's Delphi's Birthday and You're Invited
- Embarcadero News - February 2012
- Delphi Developer Days 2012 - Washington DC/Baltimore and Chicago
- Delphi XE2 Boilerplate DataSnap Server and jQueryMobile Client
News, Blogs, and Tips
Free PDF Library for Delphi Developers - Quick PDF Library LITE
MSBuild and Delphi compiler hints – binary patch
When Delphi switched to MSBuild for compiling the projects, one thing got lost at the command line: hints. The compiler still outputs them but the MSBuild task Borland.Build.Tasks.Delphi eats them and at the command line you only see warnings, errors and fatal errors. Hints are only represented by an empty line. If your project outputs many hints you will see a lot of empty lines scrolling the console window but not the hint text.
Embarcadero Delphi für Win32 Compiler-Version 22.0 Copyright (c) 1983,2010 Embarcadero Technologies, Inc. <<<<< here should be a hint, but it isn’t visible >>>>> 12 Zeilen, 0.00 Sekunden, 13508 Byte-Code, 13100 Byte-Daten. Der Buildvorgang war erfolgreich. 0 Warnung(en) 0 FehlerWith Delphi XE2 this bug was fixed, intentional or unintentional, I don’t know, but the Quality Central report #67433 is still open. But what about older Delphi versions? The policy with Delphi was always/is to stop releasing updates for older versions when a new releases comes out (Delphi 7 being the only exception as Delphi 8 was .NET only). This allows us to do some binary patching in order to fix bugs without fearing that future updates would fail to install or skip installing the update version of our modified files.
How the patch worksThe Borland.Build.Tasks.Delphi assembly uses a case-sensitive Regular Expression to identify hints from the compilers console output. Because the RegEx is case-sensitive, changing the “Hint” to “hint” in the command line compiler dcc32 will give us the result we want. The MSBuild task can’t find hints anymore and outputs them as plain text like the compiler’s copyright message. And for the localized version, we also need to patch the localized word for “Hint” in the dcc32.DE/FR/JP/… file. I use the German localized version so the example will show how to do it with the dcc32.DE file.
Why not patching the Borland.Build.Tasks.Delphi.dll ? The assembly is signed and MSBuild (.NET) won’t load the modified file. The locale resource file Borland.Build.Tasks.Delphi.resources.dll is not signed and can be modified but why patch two different files if you can patch the dcc32’s locale resource file.
The IDE compiler is not affected by the patch, so “Hint” will still be “Hint” in the IDE. Only the command line compiler will output “hint” instead of “Hint”.
Patching the command line compiler- You need a HexEditor. I’m using HxD.
- You need to backup the file $(BDS)\bin\dcc32.exe
- If you are using a localized version of Delphi, you also need to backup the locale file dcc32.de, dcc32.fr, dcc32.jp, …
- Copy the dcc32.exe file to a directory where you have write access
- Open dcc32.exe in your hex editor and search for the unicode text “Hint” (hex: 48 00 69 00 6E 00 74 00). The text appears two times. The one that is followed by the unicode text “Warning” is the one you are searching for. It should be the first match. The second match is the unicode text “hint message” that we don’t want to patch.
- Replace the upper case “H” with a lower case “h”
- Save the file and copy it back to the $(BDS)\bin directory. (Have you made a backup of the original file?)
If you only have the English version of Delphi you can skip this step.
If you want the locale compiler output to stay the way it is because you don’t like lower case words, you can skip this step and instead patch the Regular Expression in the MSBuild task’s resource file Borland.Build.Tasks.Delphi.resources.dll. (in German a lower case “hinweis” just looks weird).
- Copy the dcc32.DE file to a directory where you have write access
- Open dcc32.DE in your hex editor and search for the unicode text “Hinweis” (engl. hint) (hex: 48 00 69 00 6E 00 77 00 65 00 69 00 73 00). The text appears two times. The one that is followed by the unicode text “Warnung” (engl. Warning) is the one you are searching for. It should be the first match. The second is the unicode text “Hinweismeldung” (engl. hint message) that we don’t want to patch.
- Replace the upper case “H” with a lower case “h”.
- Save the file and copy it back to the $(BDS)\bin directory. (Have you made a backup of the original file?)
Join Embarcadero for Free Webinar on Delivering Reports Using FastReport and RAD Studio XE 2
Delphi Mapping REST Clients
I've finally posted on my public Subversion repository devoted to Delphi REST clients two of my geo-coding and mapping demos, and particularly the Google Maps Delphi client.
GeoCodingThe first is rather simple Geocoding applications, returning the latitude and longitude of a given city you enter or of all the cities in the classic customers.cds database. Code at http://code.marcocantu.com/p/delphirestclients/source/tree/HEAD/GeoLocation.
Maps in a Windows ApplicationThe second starts with the same data, but lays it out graphically on a map, as you can see below. It embeds the Geocoding code to create a list of cities and positions, but it also creates a fully working Google Map (not a static image) customized with the positions of the various customers in the database table. Since Google Maps is browser based, the Delphi application embeds a TWebBrowser, but rather than connecting to an external web server, it embeds one. The application is a Web client that uses itself as a server, passing a fixed HTML file and a dynamic XML file with the data taken from the DbGrid and its dynamic ClientDataSet.
Both applications require to sign up on Google, create a developer id, and add it to an INI file named like the program itself in the user's home folder (or "AppData\Roaming").
How to get it? Since I've been showing this application for a long time, I should have posted it before, thanks to a Delphi developer who asked me the code over email the other day. You won't guess how many people keep asking me the source code for this very old blog post of the same program, which has some of the description. Full source code at http://code.marcocantu.com/p/delphirestclients/source/tree/HEAD/GoogleMappingDemo.The command for getting all of the REST clients is:
svn co -r HEAD http://code.marcocantu.com/svn/marcocantu/delphirestclients
Want to Contribute?Finally, this repository is open for contribution: if you have Delphi applications connecting to the web for getting data and that can be considered REST clients, you are more than willing to share the code over my repository, keeping full credit and copyrights (but making the code available for free, of course). Similarly, if you have any suggestion, correction, or improvement, feel free to comment on the code site, here on this blog, or send me an email.
Switch Languages / Keyboard Layouts in Your Delphi Application
Delphi 17th Birthday Webinar Coming
David I of Embarcadero is inviting everyone to celebrate Dellphi's 17th birtday on... Valentine Day, February the 14th:
Delphi v1.0 was launched at the Software Development Conference on February 14, 1995. Several thousand developers gave the team a standing ovation during the launch.
I was there... and I'm certainly going to join the webinar (likely the first time slot) and celebrate. Will also blog, stay tuned.
RAD Studio XE2 in Action Live in Italy
Three cities in Northern Italy will see three Live Delphi events in 2 weeks including a session of mine on FireMonkey. For the Italian Delphi developers. or at least developers who speak Italian.
The event is organized by Embarcadero, with BitTime and Wintech Italia (my company). Main focus will be FireMonkey and DataSnap (with a session by Daniele Teti). The same event will be held three times in three consecutive days (February 20th to 22nd) in Bologna, Padua, and Novara (halfway between Milan and Turin).
More information and registrations on http://forms.embarcadero.com/forms/EM12Q1ITRADXE2inActionevent.
Visiting Alabama
I've been on a trip to the US last week, and quite busy, so I didn't post to the blog for quite long. Trying to catch up now, but first a short summary of the trip.
Last week I was for 5 days consulting in Birmingham, Alabama, at OneDomain. Very nice and successful company, fully focused on Delphi, and looking forward to migrate to XE2 and a DataSnap architecture. This was my second visit, since I had already been there a few years ago, and I really enjoyed it. Since I had to spend the Sunday in the US, I took the opportunity for a (free) stop over in New York (I thiink I'm getting quite good at buying flights, could set up a travel agency if things go wrong in software). As you can see from the images below, I had time for a short visit to Manhattan downtown, nice under an inch of snow. From left to right, "Construction at WTC", "Under Brooklyn Bridge", "Defenses at Wall Street", "Statue of Liberty from Battery Park".
After that I flew to Atlanta, and from there I drove a nice car (thanks to another good offer) to Birmingham. Spent a full week training and consulting (see images below) in a great weather, and had a little time for shopping Lego for kids. From left to right: "Car in front of Office", "Training", "Training", "Food break", "Shopping for Lego".
Full set of pictures on Google+ at https://plus.google.com/u/0/photos/109099686252303180605/albums/5703813642509841169.
PS. My next US trip will be for Delphi Developer Days 2012. Want to join our Delphi classes? Visit http://www.delphideveloperdays.com/


