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,777 other followers

Archive for the ‘Delphi XE4’ 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 »

There can be only MS Office sample automation server wrapper components in RAD Studio

Posted by jpluimers on 2019/02/27

There are six variations; only one can be active at a time:

  • Delphi Office 2000 Servers Package
  • Delphi Office XP Servers Package
  • Delphi Office 2010 Servers Package
  • C++Builder Office 2000 Servers Package
  • C++Builder Office XP Servers Package
  • C++Builder Office 2010 Servers Package

via: I cannot get MS Office sample automation server wrapper components. Neither of… [WayBack]

More in depth article explaining all the nitty gritty details: There Can Only Be One! Handling Different Versions of Design Packages inside the IDE | The Art of Delphi Programming [WayBack]

–jeroen

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

Delphi: uninstalling the ancient CollabNet 1.7.5 version

Posted by jpluimers on 2018/10/24

Somehow the integration team at Embarcadero still hasn’t discovered there are [WayBack] newer CollabNet SVN Client versions than 1.7.5 which has been shipped since Delphi XE3 until Delphi XE6. The newer version (currently 1.8.8 when writing this, now 1.10.2 in 2018) have plenty [WayBack1/WayBack2SVN security issues fixed.

The easiest way to uninstall the CollabNet SVN Client is running this small script:

Then install the [WayBackSlik SVN client. Like [WayBackЈοеу, I’ve switched to [WayBackSlik SVN a long ago. Here is [WayBackhis reasoning:

I have long since stopped using the CollabNet-branded version because it’s behind a registration wall. I found Slik SVN as a good alternative. It’s exactly the same command-line client you get from CollabNet, sans the hassle in downloading it.

I hope someone at Embarcadero enters this in QC^w QualityPortal as I’m awaiting Embarcadero response about a security issue there.

–jeroen

Posted in Delphi, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, QC, Software Development, Source Code Management, Subversion/SVN | 2 Comments »

How and when are variables referenced in Delphi’s anonymous methods captured? – Stack Overflow

Posted by jpluimers on 2018/09/04

Just found some notes from 2013 for my research list that are still relevant:

Note that if you are using Smart Pointers, use the ones that Spring4D implemented in 2015 named Shared/IShared<T>/TShared<T>, see [WayBack] Spring4D – Pascal Today and [WayBack2] Smart Pointers will be in Spring4D 1.2.

–jeroen

Posted in Delphi, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Leave a Comment »

“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: