At the time of writing: The Selective Debugging package currently supports Delphi XE to Delphi 10.1 Berlin. It can be downloaded here: SelectiveDebuggingSetup.zip [WayBack]
If when setting up Continuous Integration (CI) with Delphi and you get errors like E2202"Required package 'rtl' not found" or F1027"Unit not found: 'System.pas'", then something is wrong with your library path on the CI server.
Before going into the details of why, the quick solution is to set either of these environment variables in your build script
put your resources in a text RC file that can be compiled through a resource compiler
add these to your Delphi project via the project manager, so it generated RcCompile elements which instructs the build process to run the resource compiler first:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Nick Hodges did the technical review, and since Nick’s book are great I have high hopes (:
From the APress site:
Full Description
Dive into the world of MVVM, learn how to build modern Windows applications, and prepare for cross-platform development. This book introduces you to the right mindset and demonstrates suitable methodologies that allow for quick understanding of the MVVM paradigm. MVVM in Delphi shows you how to use a quick and efficient MVVM framework that allows for scalability, is of manageable complexity, and provides strong efficiency.
One of the biggest challenges developers face is how to convert legacy and monolithic Delphi applications to the MVVM architecture. This book takes you on a step-by-step journey and teaches you how to adapt an application to fit into the MVVM design.
What you’ll learn
Gain the fundamentals of MVVM
Visualize MVVM as a design philosophy
Create easy-to-use frameworks for building your own MVVM applications
Develop a methodology for converting legacy applications to the MVVM pattern
Architect cross-platform and multi-lingual applications using the MVVM pattern
Who this book is for
Delphi developers with a good knowledge of Delphi or programming experience in a different language. In addition, this book is attractive to Delphi developers who want to modernize existing applications based on the MVVM design.
and
Table of Contents
1. MVVM as Design Pattern
2. Setting Up the POSApp
3. MVVM as Design Philosophy
4. Two-way Communication
5. MVVM and Delphi
6. Planning the Application
7. Developing the Application
8. How to Convert your App to MVVM
A. Appendix: Other MVVM Delphi frameworks
An elaborate wrapper around the Define column is jedi.inc which is used in many projects (both open source and closed source) to distinguish between various Delphi versions, libraries and platforms at compile time (URL: github.com/project-jedi/jedi/blob/master/jedi.inc)
The Project Options in the Delphi IDE has a few option (like the Search Path) each with an ellipsis button (the one on the right having only three dots ... in the image below) to pop-up a dialog.
Recently when printing the 3rd time and up, you get this error in many Delphi programs and the Delphi IDE:
Printer is not currently printing.
In the past this only occurred when you used a TPrinter and forgot to call BeginDoc.
But now it always occurs after reusing the same TPrinter instance for the 3rd time and up. Since the Delphi Galileo based IDEs (8 and higher; likely older ones as well: the source code printing hasn’t changed in a long time). The error actually occurs twice: after starting a source code print job, but also after cancelling the same failed source code print job.
The pattern there is using the Printer() function which has been the way the (un)official code examples have shown for ages (Delphi 2007 Printers.Printer Function [WayBack]; earlier examples like Delphi 7 [WayBack] usually in PDF files).
Like in the Delphi 7 “5-32 Developer’s Guide” page example:
procedure TForm1.Button1Click(Sender: TObject);
var
r: TRect;
i: Integer;
begin
with Printer do
begin
r := Rect(200,200,(Pagewidth - 200),(PageHeight - 200));
BeginDoc;
Canvas.Brush.Style := bsClear;
for i := 0 to Memo1.Lines.Count do
Canvas.TextOut(200,200 + (i * Canvas.TextHeight(Memo1.Lines.Strings[i])),
Memo1.Lines.Strings[i]);
Canvas.Brush.Color := clBlack;
Canvas.FrameRect(r);
EndDoc;
end;
end;
(Yes, that’s back in the D7 days when examples were still using with and not using try/finally statements for resource cleanup).
Actual cause and permanent fix
The printing problems are caused by various recent Windows updates part of MS16-098:
After you apply this security update and you print multiple documents in succession, the first two documents may print successfully. However, the third and subsequent documents may not print.
To resolve this issue, install update 3187022. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
3187022 Print functionality is broken after any of the MS16-098 security updates are installed
This article describes printing issues that occur after any of the security updates that are described in Microsoft Security Bulletin MS16-098 are installed in Windows. You can fix these issues by installing the update that is described in this article. Before you install this update, check out the Prerequisites section.
This update applies to the following operating systems:
Windows Server 2012 R2
Windows 8.1
Windows RT 8.1
Windows Server 2012
Windows Server 2008 R2 Service Pack 1 (SP1)
Windows 7 SP1
Windows Server 2008 Service Pack 2 (SP2)
Windows Vista SP2
No solution for Windows 10 yet…
Until you install the fix: workarounds
For your own code (Thanks Remy Lebau for your answer), add this code for your BeginDoc call:
MyPrinter.Copies := MyPrinter.Copies;
You might want to keep including this in your code as you’re never sure when the end-users apply which Windows update.
For the Delphi IDE either:
Press the “Setup…” button in the “Print Selection” dialog when printing source code, then “OK” in the “Print Setup” dialog:
Print Selection dialog
“Print Setup” dialog.
Uninstall the security updated marked in blue (Security Update for Microsoft Windows (KB3177725):
A while ago, I noticed the UCL as a suffix in a few 3rd party Delphi package names.
It was from a version close to the very first FireMonkey release. FireMonkey is based on the OpenGL based VGScene (and in part DirectX based [WayBack] DXScene) which was bought form KSDev in 2011.
Contrary to VGScene and DXScene, the early versions of FireMonkey were buggy and when updating to a new version you had to cope with a lot of breaking interface changes. In Delphi XE2 for instance, there were two totally different implementations (FMX for Windows and OS X; FMI for iOS) that merged after Delphi XE3.
Around Delphi XE6 it became more stable and now – apart from some design issues I wish they had done differently – it is coming along sort of OK for Windows and for cross-platform development.
Compared to the VCL you have a lot less HiDPI issues but the designer is much more layered (which gives you the same design-time pain as WPF) and the default “Live Binding” is still buggy as hell (though if you use something like MVVM or roll your own UI bindings it becomes bearable).
A long time ago – during the Kylix era – Borland developed the cross-platform CLX library which – for the UI part – was based on Qt and ran on both Windows and Linux.
Browsing through the source code I could not find any hints so I really wonder what UCL was about. Was it again based on Qt (which compared to the Kylix era has become much more mature and has widespread use) or a different technology like LCL (given that in Delphi XE2 they used FreePascal to compile for iOS)? I rule out OpenGL as otherwise the VGScene acquisition would have been done a lot earlier.
Delphi Component/Tool vendors have to support a truckload of Delphi and C++ Builder versions which can be a pain: they have to work around problems in Delphi and C++ Builder versions that have long been abandoned by Borland/CodeGear/Embarcadero/Idera/…
This means that sometimes the Delphi Component/Tool vendors have to work around stuff in a way normal applications vendors would never do.
Recently I learned that sometimes this can be a painful thing: keeping DFM files in binary state.
I’m not kidding about either the DFM file format nor about supporting old versions:
That’s why TeeChart still has most DFM files stored as binary files (again the ‘most’ word).
For version control and searching this is a pain, so normal application developers (the ones not using Delphi XE5 Update 1 for Android work) should run convert.exe with the -t (target=text) switch on DFM binary files.