The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,734 other followers

Archive for the ‘Delphi 10.2 Tokyo (Godzilla)’ Category

Interface methods are not assignment compatible with method references or methods of object.

Posted by jpluimers on 2019/04/02

Boy I wish that QC was still up and QualityPortal was publicly indexable as that would have saved me quite a bit of time tracking this down. Luckily I got help from Stefan Glienke (who maintains the awesome Spring4D library based on modern Delphi compiler support) when I mentioned

How good are you with reference to function?
I’ve an odd compiler thing throwing errors when using interfaces but not with classes.

So, for posterity:

Unlike C#, in Delphi interface methods are not compatible with method references or methods of object.

This has many manifestations, which means you can get a variety of compiler errors. I’ve listed the ones I could find below, but presume there are more and if I find more will update this post.

These are the errors you can get:

  • E2010 Incompatible types: ‘T’ and ‘Procedure’
  • E2035 Not enough actual parameters
  • E2250 There is no overloaded version of ‘FirstOrDefault’ that can be called with these arguments

These are the (now defunct, but used to be publicly accessible) QC and QualityPortal (needs sign on) entries (thanks Stefan Glienke and Blaise Thorn for reporting these):

The really frustrating part is that the RSP is marked as “new feature” whereas clearly it isn’t, so it probably never will be fixed.

A workaround for now is to wrap the interface method references with:

  • either anonymous methods (when you have just a few classes to cover, but maybe more than a few methods on the interface)
  • or instance methods on a class (when there are many classes to cover and preferably few methods on the interface)

Examples are in the code below that also shows this works fine and dandy in C#.

–jeroen

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 10.2 Tokyo (Godzilla), Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development, Spring4D | Leave a Comment »

Berlin 10.1.2 Vcl.RibbonConsts removed, so now Vcl.ScreenTips compilation fails – Pascal Today

Posted by jpluimers on 2019/02/12

The Ribbon controls got removed since Delphi 10.1 Berlin, but the dependency in Vcl.ScreenTips remained, so:

After installing the official Delphi Berlin Update 2 I have faced nasty problem. One of my unit was using the Vcl.ScreenTips unit (for TScreenTipsWindow). And when you compile such a project you ge…

Source: Berlin 10.1.2 Vcl.ScreenTips compilation fail – Pascal Today

In the mean time however, it has been moved to GetIt: [WayBack] Ribbon Controls in RAD Studio 10.1 Berlin.

Note that the XE8 introduced [Archive.is] GetIt package manager is under the Tools menu, which is not covered by [Archive.is] IDE Insight – RAD Studio.

Anyway: here you can get it in Delphi 10.1 Berlin (now also in 10.2 Tokyo, where at first it was not available through GetIt):

jeroen

Posted in Delphi, Delphi 10.1 Berlin (BigBen), Delphi 10.2 Tokyo (Godzilla), Development, Software Development | Leave a Comment »

Don’t expect high floating point performance from the Delphi for Linux compiler

Posted by jpluimers on 2018/07/31

Don’t expect high floating point performance of the Delphi for Linux compiler as this thread proves it is not: [WayBack] Based on a recent post here, it looks like the new Linux compiler uses the x87 unit for floating point. Naturally this won’t perform well. If it is true… – David Heffernan – Google+

–jeroen

Posted in Delphi, Delphi 10.2 Tokyo (Godzilla), Development, Software Development | 5 Comments »

RAD Studio 10.2.2 Annoying New Features. Help? – Forum – Embarcadero Community

Posted by jpluimers on 2018/07/24

Does anybody know a shorter, more permanent solution for [WayBackRAD Studio 10.2.2 Annoying New Features. Help? – Forum – Embarcadero Community.

Especially the first one is very important to me.

Ever since Delphi introduced IDE layouts, it would remember the last one selected. With Delphi 10.2.2 Tokyo not so any more: it ALWAYS starts with an imposed “Startup Layout”. If you delete it, it re-appears.

I have a carefully named set of layouts that depends on the monitors I am using.

The workaround – every time I switch monitors, at least a few times a day, especially when moving between places, for instance for meetings – is this:

  1. Start Delphi 10.2.2 Tokyo
  2. Select the layout for that monitor
  3. Save it as “Startup layout”

Then each time I tweak a layout, I have to remember to save it both as “Startup layout” and as the actual named layout.

The really dumb thing is that RSP-20138 Can not define default Startup layout is classified as

“Jira-Quality Sync Service added a comment – 29/May/18 2:50 AM
Issue is reclassified as ‘New Feature'”

Via [WayBack1, WayBack2] So Embarcadero broke the “Default layout” (now always enforces a new “Standard Layout”) upon IDE startup in 10.2 Tokyo, and commented on the bug report … – Jeroen Wiert Pluimers – Google+ which has quite a few nice comments and links, including:

Read the rest of this entry »

Posted in Delphi, Delphi 10.2 Tokyo (Godzilla), Development, Software Development | 3 Comments »

“Don’t access VCL from a background thread” – how to demo that?

Posted by jpluimers on 2018/07/11

When accessing the VCL from multiple threads at the same time: adopted from ...\DEMOS\THREADS\THRDDEMO.DPR

When accessing the VCL from multiple threads at the same time: adopted from …\DEMOS\THREADS\THRDDEMO.DPR

Great question a while ago:

[WayBack] “Don’t access VCL from a background thread” – how to demo that? – Primož Gabrijelčič – Google+

For me, the ultimate way why not to access the VCL from a background thread is the precursor of the official threads demo that ships from Delphi 2 to Delphi XE6 in ...DEMOS\THREADS\THRDDEMO.DPR. where you’d think the thread isolation would be in ...DEMOS\THREADS\ThSort.pas but actually is in ...DEMOS\THREADS\SortThds.pas.

The first public showing of that demo did not include main thread protection. It originates from a session at the the 1995 Borland Developers Conference where Ray Konopka showed the below code from Bob Ainsbury.

That session reminded why this joke [WayBack] Via the EKON20 sessions… – Jeroen Wiert Pluimers – Google+ was so funny:  “When Ray Konopka enters the room you have a Raize condition.“.

The question above also made me find back this reference to BorCon95 in San Diego:

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 10.2 Tokyo (Godzilla), Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »

 
%d bloggers like this: