-
Update 1 for RAD Studio XE2 is available
Posted on September 28th, 2011 1 commentToday, just less than a month of releasing the original XE2 product, Embarcadero published the first update of a series of frequent updates for RAD Studio XE2 (including Delphi XE2 and C++ Builder XE2). Update 1 contains 120 bug fixes in FireMonkey, VCL Styles, compiler, and IDE. This update is mandatory for installing the future updates. Here is the official announcement: Update 1 for Delphi XE2, C++Builder XE2 and RAD Studio XE2 . Make sure to read Release Notes for Update 1 before installing it, because Update 1 requires a full uninstall of original XE2 installation and is not a simple upgrade. You can also see a list of all bug fixes in this update here: Delphi XE2 and C++Builder XE2 Update 1 Bug Fix List .
As I checked the bugs list, at least one bug regarding BiDi support (QC # 97965) is fixed in VCL Styles. No other BiDi related bugs are fixed in this update. Embarcadero staff mentioned in Embarcadero newsgroups that the company is planning to release monthly updates for XE2 product, so we should wait to see if any of the BiDi related bugs will be fixed in the coming updates or not.
-
Enumerating Windows services
Posted on September 13th, 2011 3 commentsA while ago, I had to enumerate all Windows services for a project. I was browsing the source code today, and thought maybe it would be a good idea to talk about this matter in a blog post, and publish a sample source code to achieve this.
The easiest way to enumerate Windows services is using WMI. Of course using WMI requires some basic knowledge of MS COM technology which is tricky, but thanks to the great tool. Delphi WMI Class Generator by Rodrigo Ruz, you can have a ready Delphi class for obtaining information about installed services on a Windows machine without even writing a single line of code. All you have to know is that WMI class for Windows services is Win32_Service under root\CIMV2 namespace. Delphi WMI Class Generator will generate a unit named uWin32_Service.pas which contains a class named TWin32_Service. This class returns info about a single service for you. If you need to enumerate all installed services, you need to write a couple of codes to call its GetCollectionCount to retrieve number of available services, and SetCollectionIndex to set current item index for the class. Here is a sample code to retrieve names of all installed services on the local machine using TWin32_Service class:
var i: Integer; begin with TWin32_Service.Create do try for i := 0 to GetCollectionCount - 1 do begin Writeln(DisplayName); SetCollectionIndex(i); end; finally Free; end; end;However, WMI is slow, and it relays on WMI service. If you need a faster way to enumerate Windows services, or if for whatever reason WMI service is disabled or not working on your target machine; then you have to relay on Windows API. Using Windows API for this purpose is not as easy as using the automatically generated TWin32_Service class. I am not aware of a single Windows API function that can enumerate Windows services for you and give you all the detailed information which WMI returns for each service. You have to call roughly a dozen of API functions to enumerate Windows services and retrieve some nice information for each service.
First you need to open a handle to service manager on the target machine by calling OpenSCManager function, then you should call EnumServicesStatusEx function to enumerate available services, and retrieve their names and status. If you just need service names and status, you are done, but if you need to retrieve description and configuration for each service too, then you should open a handle for each service using OpenService function by giving it service name which you obtain through EnumServicesStatusEx call , and then call QueryServiceConfig and QueryServiceConfig2 functions to get the required configurations. At the end you should make sure you free all the allocated buffers, and close all handles. Delphi installation does not provide header translation for some of these API functions (particularly EnumServicesStatusEx and QueryServiceConfig2), but they are translated and available for Delphi by well-known Project JEDI, and their JEDI Windows API Headers which contain the majority of Windows headers. If you are a Delphi developer and have not heard about them yet (That would be weird!!), you can download the package from this link.
Anyways, in the source code below, I wrapped all of those API calls into a class named TAkServices. This class holds an internal list containing information for each Windows service installed on a given machine. I tested it on both Delphi 2010 (Win32) and Delphi XE2 (Win64):
-
FireMonkey and support for bi-directional text – Part 2
Posted on September 11th, 2011 4 commentsLast month when RAD Studio XE2 was still in Beta phase, I wrote a weblog post about bi-directional (BiDi) text support in KSDev VGScene (ancestor of FireMonkey), questioning FireMonkey support for BiDi text, and why it is important to support it. As I mentioned in a post-script update, Andreano Lanusse commented on my post, and told us BiDi text would not be supported in the initial version of FireMonkey. Now it is been around a couple of weeks that the official RAD Studio XE2 is released, and its trial version is available for download. I decided to test BiDi support in the official FireMonkey using the trial version, and write the second part of my investigation on BiDi text support in FireMonkey.
First of all I should mention that I didn’t expect any BiDi support in this version, so my initial intention was to highlight the bugs for BiDi support in FireMonkey and report them to be hopefully fixed in the future releases. The first impression was that FireMonkey is not as bad as VGScene in supporting BiDi text. It was a surprise because I didn’t really expect any BiDi support after reading Andreano’s comment. There is very limited and half baked support for BiDi text in the initial release and it still has a long way to go for fully supporting BiDi text. Here I am going to discuss support for BiDi text in FireMonkey version 1.0, highlighting the bugs which should be fixed regarding this support, and the QC report regarding each bug.
Before I discuss BiDi support, I should mention that according to Michael Swindell, Senior vice president of marketing and product management at Embarcadero, FireMonkey will be updated frequently. The first update is expected before the end of September, and the other updates will be published more often than quarterly [Source]. That means, we will see several updates for FireMonkey before the new version of RAD Studio is published next year. That is really exciting and makes me very hopeful that all or at least many of the bugs mentioned here might be fixed before the next major release of RAD Studio in 2012. It is important to be hopeful about evolution of a product, and feel that your feedbacks are really considered by its developers. Years ago many of my friends tried to notify Borland about some of the existing bugs in VCL regarding BiDi and right-to-left languages support, but they never got fixed, and many of those guys migrated to .NET, abandoning Delphi. I myself stopped reporting any new bug to QC when Embarcadero deleted my EDN account just because my country in my profile was mentioned as Iran. Now I feel the team listens more to user feedbacks. It doesn’t really matter if I am Iranian or American or whatever when I am reporting a bug or when I am discussing some technical stuff. Anyways, that is another story and I discussed that in an older blog post. Let’s go back to FireMonkey and its support for BiDi text:
-
RAD Studio XE2 is released!
Posted on September 2nd, 2011 4 commentsEventually RAD Studio XE2 is RTMed and ready for download. There is a good article in the online documentation wiki about what’s new in Delphi and C++ Builder XE2. You can also view the features matrix for different editions here.
And here is download link for the 30-days trial version from Embarcadero. Before installing the final version, if you already have XE2 beta installed, make sure you uninstall it completely and remove all of its folders which might remain undeleted; otherwise, you might have to deal with weird installation issues.
I hope this will be a new start for Delphi

