Desiderata software® and consultancy blog
specialising in clinical database solutions for Australian hospitals
specialising in clinical database solutions for Australian hospitals
Jun 27th
I have successfully migrated my very complex Delphi XE database application to Delphi XE6 after upgrading my 3rd party control sets such as Infopower, 1st Class, Devart’s UniDac, QuickReports and TMS Smooth controls.
So I decided I would add in some VCL Styling which is extremely easy to add in – just go to Project Options, Application, Appearance, then tick the VCL styles you would like available to your application (these will be stored within the EXE), and select your Default style via the drop down box at the bottom.
The Delphi IDE writes to your project source file (the DPR file) the following: adds vcl.Themes and vcl.Styles to the Uses clause, and adds the default style to your application run code such as: TStyleManager.TrySetStyle(‘Aqua Light Slate’);
The files for the VCL Styles are located at C:\Users\Public\Documents\Embarcadero\Studio\14.0\Styles.
Don’t forget, you may be able to download Embarcadero’s “Premium Styles Pack” as part of your purchase of Delphi or RAD Studio – if so you will need to copy these to the above folder. This pack includes “Diamond”, “Jet” and “Sterling”
If you wish to allow your end users to change styles at runtime, then you can create a dialog form, place a combobox on it and add code:
Uses vcl.Themes, vcl.Styles;
procedure TdlgStyling.ComboBox1Change(Sender: TObject);
begin
TStyleManager.TrySetStyle(ComboBox1.text);
end;
procedure TdlgStyling.FormCreate(Sender: TObject);
var i:Integer;
begin
for i := 0 to High(TStyleManager.StyleNames) do
begin
ComboBox1.items.Add(TStyleManager.StyleNames[i]);
if (TStyleManager.StyleNames[i] = TStyleManager.ActiveStyle.Name) then
ComboBox1.itemIndex := i;
end;
end;
Not all controls display well with every style, so either avoid the style or turn off styling for the controls.
Things to watch out for include:
Menus will get deranged if any menu items have visible = false and a VCL style is active
This is a Delphi vcl bug and applies to both TMainMenu and TPopup – items get changed in position and become associated with incorrect OnClick events!
There are a few reports posted on Quality Central indicating there are issues with DXE6 Update 1 – see http://qc.embarcadero.com/wc/qcmain.aspx?d=124944 and similar.
Menu issue workaround: The issue appears to resolve if you ensure there are no menu items with visible := false.
Access violations may occur which need sorting out:
Code which previously appeared to work flawlessly, may throw access violations as soon as you have a VCL style running
This may be happen due to some unorthodox ways forms are used – I managed to fix one of these by removing a call to a password dialog from the mainform’s OnCreate (I had it there as I used the type of log on to customise how the main form displays.
Delphi IDE includes are tool to let you do this – see Tools > Bitmap Style Designer
http://docwiki.embarcadero.com/RADStudio/XE6/en/Working_with_VCL_Styles
https://code.google.com/p/vcl-styles-utils/source/browse/#svn%2Fwiki
Jun 26th
Variants.EmptyParam issue:
If you use COM, in addition to this not being cross-platform technology, if your code passes Variant.EmptyParam (as an OLEVariant) in code XE or earlier, you will need to modify your code as EmptyParam as of XE2 is a function not a OLEVariant variable you can pass as a Var in a procedure or function.
Solution:
To solve, this, for each var parameter, you must explicitly declare a variable as an OLEVariant, then use that variable in the procedure or function after you have set it’s value to Variants.EmptyParam.
for example:
procedure doSomeCOM;
var docfilename, docpassword:Olevariant; docs: Documents; doc:Document;
begin
docfilename := ‘mydoc.doc’;
docpassword := Variants.EmptyParam;
Docs := WordApp.Documents;
Doc := Docs.Item(Index);
Doc.someCOMFunctionTakingOLEVariants(docfilename, docpassword);
end;
NativeInt instead of Integer in some procedures and functions;
This will require changing variables for some functions such as Application.OnHel from LongInt to NativeInt;
Deprecated and removed Delphi language:
sysutils.shortdateformat no longer compiles, you need to create a variable of TFormatSettings, then you can access the global shortdateformat
You will need at least 30GB free hard drive space on your C: drive to actually do the install!
BDE on 64 bit Windows:
See my earlier blogs on running this but assuming you have it running successfully, if you had BDE ticked in the Delphi XE6 install wizard then you may find you need to go into regedit and manually ensure that the path to the BDE library is correct. under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Borland\BLW32\
You will need to download and install the latest versions of other code sets such as:
Jedi JCL – 17th April 2014 version installed without issue
Jedi JVCL – I couldn’t get this one to load the jvclstdcontrols due to an error in the entry point – keep an eye out for latest version
IDE Fix pack – you need v5.6 for XE6 but seems there is no update of the MIDAS speed fix – so I disabled the older version I had as it caused syntax error.
Quickreports – at least their XE to XE6 upgrade is free BUT seems now you must explicitly set the default printer by adding qrepname.PrinterSettings.PrinterIndex := -1;
Infopower Studio – but now there is also a Firemonkey component set – but not for the 1st Class VCL components at this stage at least.
Unidac database components from Devart – if you don’t want to try the task of migrating your code to Firedac components
TeeChart Pro – Delphi XE 6 does come with standard and “Lite” TeeChart components sets but if you need pro then you need to upgrade.
Jun 19th
Delphi programmers who have not upgraded since Delphi XE and thus have been very happy just sticking to their VCL programming have until 30th June 2014 to upgrade to Delphi XE 6. After this date, they will not be able to upgrade but will have to pay the full NEW price of the latest Delphi or RAD Studio version.
Short answer … probably yes especially if you really want to start using the many new features of XE 6 now rather than wait for XE 7 which will presumably be even better and will presumably have additional features such as support for iOS 8 development, Bluetooth tethered apps, etc.
If we assume Delphi XE 7 prices will be similarly priced, then later this year or early next year, one could “upgrade” to Delphi XE 7 Enterprise via 3 mechanisms:
Buy Delphi XE 6 Enterprise now then upgrade again:
Purchase Delphi XE 6 Enterprise upgrade and maintenance:
Cost for the upgrade to XE 6 will be ~$AU1000 more but then you get the next new version(s) released in the following 12 months for free – presumably that will give you XE 7 and XE 8, so it could be more cost effective than going for just a re-charge to XE 7, particularly, as I understand you also get access to every prior version as well which can be handy.
Ignore Delphi XE 6 and await Delphi XE 7 Enterprise:
Conclusion – buying XE 6 now will get you started on the new features, and may just save a few hundred dollars (even more if you decide you don’t really need the XE 7 upgrade).
FireDAC database components and technology
Compile for 64-bit Windows applications
VCL styling – but XE6 Update 1 has bug issues with menus if any menu item has menuitem.visible = false
Live bindings to allow making almost any control data aware with a much improved binding interface
Easy REST client programming
Support for Windows 8 and “metro” style windows apps optimised for touch
Support for portable device sensor technologies such as location, gyroscope, etc.
Taskbar manager to allow nice taskbar icons showing app screen shots or button controls
Improved Datasnap
Zip file support
Easier remote debugging
Improved IDE Insight to help you find things while you program
App tethering
Improved IDE stability and quality control
Access cloud based BaaS – although these services are quite expensive
Much of the initial issues and bugs in FireMonkey and the process of developing for other platforms such as MacOS, iOS 7, and Android has been improved and simplified.
XE6 now also allows Google Glass development.
In app monetization via advertising banners and in-app purchase functionality – BUT only for Android and iOS apps
If developing native apps for these platforms is important then one should at least consider what FireMonkey can offer.
Others may prefer to just create web apps based upon HTML5 technology, but this may miss out on providing the same user experiences.
The price of the Embarcadero tool cannot exceed the price of your upgrade, and you must have installed and registered your upgrade, then accessed the bonus tool before 15th July.
The other free goodies include TMS VCL components including Smooth Controls Pack, Metro Pack and Windows 7 pack, total value of which would be worth around $AU300.
The ADUG president, Lachlan Gemmell, has created an excellent webinar describing these benefits for VCL programmers and this can be downloaded from Steve Arena’s online store for free.
Happy upgrading.
Feb 13th
I have a complex Delphi 2007 multi-user 24×7 MS SQL Server and Sybase ASE database application which uses dozens of TClientDatasets connected to TDatasetProviders which then connect to separate datamodules containing TDatasets (eg. TQuery or TSQLQuery) which link to a connection component (eg. TDatabase or TSQLConnection).
I have 3 almost identical versions with different datamodules:
The word from Embarcadero now that they have purchased the excellent 3rd party database components – AnyDAC, is that AnyDAC will be included in Delphi XE4 – presumably late 2013 – but is no longer available for purchase separately, and that the DBExpress technology is likely to be deprecated given they had troubles addressing a few of its issues.
Given this news and not wanting to wait until Delphi XE4, I decided to jump in and buy DevArt’s UniDAC components for Delphi which come highly recommended.
After installing the Unidac components – very painless process indeed, you will discover a new item on the Delphi IDE menu bar – UniDAC under which you will find a Migration Wizard tool.
The good news is that the Migration Wizard is very easy to use and seems to work well by converting the BDE components to UniDAC components – just tell it which folder to convert and away it goes (best to back everything up first of course, although the wizard does have an optional backup functionality).
The bad news is that although the wizard will migrate from BDE, ADO and other DevArt components such as SDAC, there is no option to migrate from DBExpress – this seems like it would require a significant amount of search and replace work in the pas and dfm files.
Obviously some BDE features will not be supported such as aliases and if your database connection or your code relies on this then these aspects will need addressing.
You will have to set the properties on the TUniConnection component (UniDAC database driver, server, database, username, password, then look in SpecificOptions to enter ApplicationName, WorkstationID, etc), plus you will need to reconnect all your dataset.connection properties to the TUniConnection component, plus if you are like me and using TClientDatasets, then you should set all the TUniQuery.UniDirectional = true.
If any of your SQL has double quotes, these will need to be changed to single quotes – easiest way to do this is by opening the datamodule as text file (right click then select “View as text”), then do a search and replace, replacing all ” with two single quotes.
Finally, you will need to drop the UniDAC provider components onto your datamodule – eg. TSQLServerUniProvider, TASEUniProvider.
Aug 24th
Embarcadero’s Delphi RAD Studio programming IDE has a new version coming Sept 2012 – Delphi XE3.
I attended their World Tour presentation in Melbourne today and this post is to briefly inform of the new features it brings.
Delphi XE3 is a very timely product launch which will leverage the new requirements of Windows 8, and Mac OS Retina displays whilst significantly extending and simplifying cross-platform and mobile application development with tools such as FireMonkey and HTML5/CSS/javascript apps.
This will be a must buy version for those interested in such application development.
Mar 11th
There is a little trick to connecting to a password protected .xls Excel spreadsheet using the Jet 4.0 OLEDB driver.
If one uses the obvious Password=xxx;User Id=Admin you will get an error “Workgroup Information file missing or file is in use by another user”.
The ADOConnection will return an active connection is using the following connection string but in Delphi 2007 I am still getting an error on trying to read the file “Could not decrypt file”.
So here is the Connection String which will open the connection successfully in Read Only mode:
Provider:=Microsoft.Jet.OLEDB.4.0;Data Source=C:\temp\MyExcel.xls;Mode=Read;Extended Properties=Excel 8.0;Jet OLEDB:Database Password="xxx";
It appears that “Could not decrypt file” error is due to a well known limitation of the Jet OLEDB 4.0 engine in that it always returns this error on trying to read a password protected Excel file even if passwords are known.
The hack around this is to open the file in Excel first in full read/write mode BEFORE opening the TADOConnection – just opening it in READ ONLY mode in Excel WILL NOT work!
This is not only an issue in Delphi but in any application that uses Jet 4.0 OLEDB engine.
Of course, another solution is to use COM OLE automation such as:
If you are dealing with .xlsx Excel 2007 or later files, you cannot use the Jet engine, but you can use the ACE OLEDB driver:
Provider := Microsoft.ACE.OLEDB.12.0;Data Source="C:\temp\MyExcel.xlsx";Extended Properties="Excel 12.0 Xml;HDR=YES;
“;Jet OLEDB:Database Password=””;Provider := Microsoft.ACE.OLEDB.14.0;Data Source="C:\temp\MyExcel.xlsx";Extended Properties="Excel 12.0 Xml;HDR=YES;
“;Jet OLEDB:Database Password=””;Aug 30th
Embarcadero’s RAD Studio XE2 allows the following database development pathways:
Delphi Object Pascal or C++ generated DataSnap middle tier data servers which run on a Windows server and allows the following thin clients to connect to it:
Third party REMObjects is extending its Hydra technology to allow FireMonkey plugins to work on VCL Winforms, and vice versa, as well as WPF plugins to work in FireMonkey apps and vice versa – see here.
RADPhP web database application using MySQL database.
Aug 4th
Delphi developers are in for a big surprise as the World Tour of RAD Studio XE2 brings them some very unexpected opportunities as well as the expected Win64 compiler.
Here are a few of the new features in XE2:
Very exciting times indeed!!
You can register for the Australian part of the World Tour demonstrations here – the Melbourne event is next Thursday, the 11th August 2011.
Jun 3rd
Skype was written in Delphi which made it easy to download to users with any Windows machine without having to worry about users having to download MB’s of java or .NET support files.
This ease of configuration from the net was one of the reasons that made Skype so popular.
It will be interesting to see what Microsoft does with it now that Google is also entering into the VOIP marketplace with its Google Voice product which uses SIP addresses (SIP technology is now in some of the new mobile phones) – Google Voice is currently only available in the US.
Recent Comments