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 2,481 other followers

Archive for the ‘Delphi XE8’ Category

System.TypInfo.SizeOfSet – RAD Studio API Documentation

Posted by jpluimers on 2021/08/11

This seems to have been introduced into Delphi Berlin: [WayBack] System.TypInfo.SizeOfSet – RAD Studio API Documentation. Maybe slightly earlier, but at least it was not documented in XE8 [WayBack] (via [WayBack] Delphi “SizeOfSet”.).

This is a useful function, for instance to get the Cardinality of a set in [WayBack] delphi – How can I get the number of elements of any variable of type set? – Stack Overflow.

From what I can see, the undocumented TLargestSet type also got introduced in Delphi Berlin.

Few hits by Google on [WayBack] Delphi “TLargestSet”, including [WayBack] Free Automated Malware Analysis Service – powered by Falcon Sandbox – Viewing online file analysis results for ‘Coperativa.exe’.

Not much more is documented than this in Tokyo [WayBack]:

System.TypInfo.SizeOfSet

Delphi

function SizeOfSet(TypeInfo: PTypeInfo): Integer;

C++

extern DELPHI_PACKAGE int __fastcall SizeOfSet(PTypeInfo TypeInfo);

Properties

Type Visibility Source Unit Parent
function public
System.TypInfo.pas
System.TypInfo.hpp
System.TypInfo System.TypInfo

Description

Embarcadero Technologies does not currently have any additional information. Please help us document this topic by using the Discussion page!

–jeroen

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

Odd error on my Delphi research list: “E2213 Bad packaged unit format”

Posted by jpluimers on 2021/04/13

Just so I remember this did not compile in Delphi XE8 a while ago:

[dcc32 Fatal Error] DisableAlignPropertyEditor.dpr(15): E2213 Bad packaged unit format: c:\program files (x86)\embarcadero\studio\16.0\lib\Win32\release\rtl.dcp.System.SysUtils - Expected version: 29.0, Windows Unicode(x86) Found version: 32.0, Windows Ansi(x86)

Possible starting point: “E2213 Bad packaged unit format” “Expected version” “Found version” “Windows Unicode” “Windows Ansi” – Google Search

–jeroen

Posted in Delphi, Delphi XE8, Development, Software Development | Leave a Comment »

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 »

database connection – Looking for a generic way to pool TCusomConnection in Delphi – Stack Overflow

Posted by jpluimers on 2018/10/11

What is the proper way for pooling of TCustomConnection instances in Delphi, that allows to distinguish between instances that have effectively equal connection properties and the ones that are effectively unequal?

I’ve tried searching the RTL and VCL sources and didn’t find a generic way.

I could copy either of the specific ones I found (see list below) and adapt them to a more generic solution or adapt one of the answers in #16404051 to be for TCustomConnection, but I wonder if there is an existing solution for TCustomConnection in the first place.

Specific ones I found in Delphi XE8:

  • DBX: unit Data.DBXPool
  • FireDAC: unit FireDAC.Stan.Pool
  • IBX: unit IBX.IBConnectionBroker

Source [WayBackdatabase connection – Looking for a generic way to pool TCusomConnection in Delphi – Stack Overflow

Hopefully by now I’ve some implementation for this that works nicely.

If not, these might get me started too:

In the .NET world, I take these things for granted, and it looks like ADO already does it out of the box as well:

–jeroen

via: [WayBack] Is there a Delphi library that allows for pooling of TCustomConnection… – Jeroen Wiert Pluimers – Google+

Posted in Delphi, Delphi XE8, Development, Software Development | 2 Comments »

 
%d bloggers like this: