Modernizing Delphi VCL apps for Windows 10


A few days ago I presented a webinar as part of Embarcadero’s “Modernize with Embarcadero” series this month. If you haven’t caught any of these webinars then there’s still time to drop in and take part. The link to view the topics and presenters along with registration is here: https://www.embarcadero.com/events – there is some seriously good content ranging from novice to advanced and it’s all completely free!

My session can be caught on replay, which includes the live Q & A section by going to here and registering after which you’ll be taken directly to the video: https://register.gotowebinar.com/register/4125077757680574467?source=social

You can view all the replays here: https://community.idera.com/developer-tools/b/blog/posts/windows-10-modernize-webinar-series

Who am I? Why Delphi?

In case it’s not clear – my name is Ian Barker and I am an Embarcadero MVP. As it says on the EMB page – MVPs are experienced Delphi programmers who have a belief that the product provides benefits to developers and are happy to champion Delphi and explain why the MVP thinks RAD Studio and Delphi are great tools. For me, as a Delphi developer since the very first day Delphi 1 was released, it’s a no-brainer. I code every single day in Delphi. I specialize in ‘shrink-wrapped’ software – applications that go out to end-users rather than corporates or in-house walled-gardens.

My income depends on being able to produce apps which work with minimal problems – mostly, I create bugs, just the same as other mortals – and have those apps be stable, reliable and cost-effective to produce. According to contacts and customers I am a very prolific developer and work on a pretty large number of projects in a year. This is despite the fact I am quite lazy and have all the normal demands on my time such as dogs who insist on being walked, my wife, Lisa, who apparently likes to do things called “going out and being social with normal people” and a daughter who insists I do dad things.

Delphi has meant I can write code which works – and keeps on working – on a vast number of operating system versions and devices. It makes me look good. It makes me appear competent. Perhaps more importantly it also makes me employable.

So it’s not too much of a stretch to say good things about it. I don’t work for Embarcadero – I work for myself – although I do get some benefits such as access to the latest products and some insider knowledge.

That said, what you hear from me is the truth – Delphi can give you superpowers.

The webinar

I’ll try and briefly summarize some of the key points in this post – but you really should catch the replay if you can as it includes live examples.

The presentation looked at some RAD Studio and, in particular, Delphi features you can take advantage of today to make your existing – and new – apps look, feel and behave like modern Windows 10 applications.

Windows 10

The thing about Delphi is that it’s solid. Really really rock solid reliable runs-for-ever-without crashing solid. Because of that there’s a LOT of code out in the wild which was created with older versions of Delphi such as Delphi 2009 and even the venerable Delphi 7. Borland, as they were at the time, really got it right with Delphi 7. It was an IDE which worked well, was easy to use and supported a version of Delphi which was unshakable in almost all sorts of wide and varied deployments. No crazy operating systems dependencies, no ‘dll hell’, no need in fact for almost anything other than the finished EXE to provide the functionality.

I know of code out there running power stations, airport security scanners, Fortune 500 company payrolls, medical patient education systems… I know because I wrote some of these myself.

But as good as the older versions of Delphi 7 was it was released in an era where Microsoft were a very different animal. The modern Windows 10 builds on Windows NT technology behind the UI along with some of the great user interface schmooze ideas that started out back in the days of Windows XP which in itself was a huge improvement on what came before and still hobbles around sporting that Tellytubbyesque green hilly backdrop on dusty computer systems despite Microsoft having long abandoned it. Some operating system versions are really hard to kill.

Windows 10 is a truly useful operating system. When it did away with some of the missteps of Windows 8 – dropping the idea of being a ‘tablet operating system for your desktop’ and instead striving for greatness it accompanied a new CEO, Satya Nadella, to replace the mercurial Steve Ballmer. With Satya came a massive push into Microsoft fanatically embracing open source and an overwhelming campaign to get Windows 10 on every possible PC desktop… for free.

But it didn’t stop there. After dabbling with a mobile phone Microsoft instead reoriented itself to aim at the “internet of things” so that Windows 10 can now power things like the Raspberry Pi, touch devices like the Microsoft Surface and even now includes Linux built in. Even the once sworn enemy of Microsoft – Richard Stallman – just gave an invited talk to the Microsoft Campus in Seattle.

This. Is. Weird.

But also, what it really means is that Windows 10 is absolutely everywhere. This is great, but it also means that all this legacy code from compilers like Delphi 7, Delphi 2009 and yes even the original Delphi XE looks out of date.

Those compilers were perfectly serviceable but their runtime libraries and VCL were created before the release of such things as “fluent design’ which is a user interface design methodology and ethos used not just in Windows 10 but across other devices such as Apple Macs and Linux desktops. They call it a different name and the exact chronology and provenance are complex but suffice to say; if your app was written with an older version of Delphi then it probably looks like it’s a little… how shall I put this… stale?

Getting the beauty treatment

Happily there’s some easy things we can do to freshen things up. If you haven’t already, grab a copy of the latest release of RAD Studio Delphi, open up your projects, recompile and immediately you’ll have given them a waft of that new car smell.

Right, of course, if you’ve used a lot of third-party components – and who doesn’t, that’s part of the strength of Delphi – then you’re going to need to find updated versions. In theory if you have the source code you can recompile the component libraries but in practice it’s never quite that easy, especially if they’re from something more than 5 years ago.

I just converted a fairly significant Delphi 7 project to Delphi XE10 last year – ~1.5 million lines of code – and for the most part it was plain sailing. We went out and found updated versions of the component sets we’d used and for some we converted to either alternative vendors (who frequently have tools to assist with this) or reworked code to use new controls. But overall it wasn’t that horrible. Some sections of code were rewritten, mainly around cryptography and some comms, but really that was about it.

The Delphi language is very good at being backwardly compatible.

Getting a copy of the latest version of RAD Studio/Delphi

Last year a momentous thing happened. Embarcadero, with the blessing of their new parent, IDERA, released a “Community Edition”. This is free as in beer and remains free for developers who are learning to code, experimenters and hobbyists and for Open Source projects.

What’s even more wonderful is that this Community Edition is exactly the same as the Professional Edition of RAD Studio. This means you can produce apps which will run on Windows, macOS, Android and iOS – without the need for anything else (iOS and macOS apps need a Mac – real or virtual – to deploy. That’s an Apple restriction).

Seriously – you could be teaching yourself to create mobile apps today. If you scoot on over to the Embarcadero Academy you can even find a whole load of tutorials on how to do it.

One set of program code – target all those devices. Why aren’t you doing it? 🙂

For those who are professional developers or who do not otherwise fit into the requirements of the Community Edition there are trial versions of RAD Studio where you get to play with the most powerful version of RAD Studio Delphi for free for a limited time.

Why Delphi 10.3?

I summarized it in the webinar like so:

  • GORGEOUS new themes and templates both for VCL and Firemonkey – all of them free via GetIt plus many built-in too
  • A deluge of new Windows 10 APIs
  • Specific VCL components targeting Windows 10 features and capabilities
  • APPx packaging and deployment – for local “ad-hoc”
  • APPx with Windows Store support • 64bit Windows support – especially important now for Windows Server 2019
  • High-res DPI support and “per-monitor V2”

Great – but what are they and how do we use them?

Well, to avoid making this blog post into even more of a word-monster than it is I’m going to create a new post here every day this week covering each of the new features and capabilities.

You can go and watch the webinar replay if you don’t want to wait – but if you can hold off I’ll be covering a whole bunch of Windows 10-specific tips this week you can slot into your own programs, almost without any effort.

Meanwhile, I’m off to carry on coding a Windows 10 alerter service – in Delphi 10.3 Rio, of course.

I’ve said it before – Delphi is my superpower.