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,830 other subscribers

Archive for the ‘Delphi’ Category

multithreading – Closure in TTask.Run(AnonProc) not released after AnonProc has finished – Stack Overflow

Posted by jpluimers on 2018/03/06

For my link archive: [WayBackmultithreading – Closure in TTask.Run(AnonProc) not released after AnonProc has finished – Stack Overflow

via: [WayBackHow the combination of inline, interfaces and missing RVO can break your code – Stefan Glienke – Google+

TL;DR from RAD StudioRSP-12462 TThreadPool worker thread holds reference to last executed task by Asbjørn Heid as a regression since XE8:

A temporary variable in TThreadPool.TQueueWorkerThread.Execute keeps a reference to the last executed work-item (task), which is only released when the Execute method ends.

Being in a pool the thread is usually kept alive until the pool is destroyed, which for the Default pool means during finalization of the unit. Thus the last executed tasks are not released until the program terminates.

–jeroen

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

WouterVanNifterick/C-To-Delphi: C To Delphi converter

Posted by jpluimers on 2018/03/01

Reminder to self: check out WouterVanNifterick/C-To-Delphi: C To Delphi converter and the state it is in now.

via: [WayBack] Hi, I’ve created a C to Delphi converter.Because it’s been so useful to me that I’ve decided to share it.It converts C code as-you-type, and it keeps… – Wouter van Nifterick – Google+

–jeroen

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

Do NOT download the Embarcadero patch for RAD Studio 10.2.2!

Posted by jpluimers on 2018/02/11

[WayBack] Embarcadero just released a patch for RAD Studio 10.2.2. It breaks linking projects with runtime packages, like GExperts, any other IDE expert and probably also most component packages. – Thomas Mueller (dummzeuch) – Google+ in a response to [WayBack] RAD Studio 10.2.2 Tokyo February 2018 Patch available now at https://cc.embarcadero.com/item/30819. This patch for RAD Studio 10.2.2 (build 2004)… – Marco Cantù – Google+.

RSP-19914 (by Thomas Mueller)

Summary

After installing the RAD Studio 10.2.2 Tokyo February 2018 Patch I can no longer compile any project with “Link with runtime packages”.

Error message:
[dcc32 Fatal Error] Project1.dpr(5): E2225 Never-build package ‘vcl’ must be recompiled

Steps to reproduce

1. Create a new VCL project
2. Open project options
3. Select Packages -> Runtime Packages
4. Set “Link with runtime packages” to true
5. Close dialog with OK
6. Compile the project
-> Error

You might have noticed that the MVP logo is no longer on the blog. It got revoked because I was too critical. Given releases like the above, I can’t stop being critical in a public way as the internal ways to effectively voice criticism that used to work in the past stopped working a long time ago.

Not just the MVP was revoked, the account to which the MVP was attached got killed without notification. That account also had the tech-partner licenses attached: the ones I used to support Delphi open source projects. Which means I do not have any Embarcadero provided licenses to support open source Delphi projects any more except the ones I own (the most recent ones being Delphi 2007 and XE4).

Many people in the Delphi community even refuse to become MVP because formally the MVPs are not allowed to be be critical publicly. Which means these community members have a limited list of Delphi versions they can use to support and test their open source projects with.

I am glad for the time I could use those licenses to support open Delphi source projects, but alas, that time is over. I still like the concepts of Delphi as those are strong. I don’t like how Embarcadero handles their infrastructure and product quality.

In the next 2 years there will be Delphi posts on my blog as that’s about the depth of the posting queue right now. After that: time will tell. For the last decade or so, I’ve spend more free time supporting Delphi than spending time on paid Delphi projects. That won’t last forever.

For now I’m going on a two week holiday tomorrow after which I will be available for new projects.

–jeroen

Related:

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

Mixing x64 Outlook with x86 Delphi: never a good idea…

Posted by jpluimers on 2018/02/07

Via [WayBack] Hi all,I’m a bit stuck here with a “simple” task.Looks like Outlook 2016 doesn’t supports “MAPISendMail”, at least, if i trigger this, Thunderbird… – Attila Kovacs – Google+:

Basically only MAPISendMail works cross architecture and only if you fill all fields.

This edited [WayBackemail – MAPI Windows 7 64 bit – Stack Overflow answer by [WayBack] epotter is very insightful (thanks [WayBackRik van Kekem – Google+):

Calls to MAPISendMail should work without a problem.

For all other MAPI method and function calls to work in a MAPI application, the bitness (32 or 64) of the MAPI application must be the same as the bitness of the MAPI subsystem on the computer that the application is targeted to run on.

In general, a 32-bit MAPI application must not run on a 64-bit platform (64-bit Outlook on 64-bit Windows) without first being rebuilt as a 64-bit application.

For a more detailed explanation, see the MSDN page on Building MAPI Applications on 32-Bit and 64-Bit Platforms

–jeroen

Posted in Delphi, Delphi x64, Development, Office, Outlook, Power User, Software Development, x86 | Leave a Comment »

GetPublished – Author Information

Posted by jpluimers on 2018/02/01

One day I must re-publish these papers:

Author Information

ID: 1454
First name: Jeroen W.
Last name: Pluimers
User name:
Biography: Jeroen Pluimers has had a long history in software development ranging from high-level knowledge-based systems to low-level communcation. After discovering his love for teaching, he started one of the first Delphi consulting firms in Europe, and has been speaking at national and international conferences ever since. He presents on Delphi, C#, the Microsoft .NET Platform, and Linux. Jeroen is a Certified Delphi Developer and Borland Certified Instructor. Jeroen’s strength is in getting totally different technologies to work together. He likes to integrate different languages, platforms, frameworks, and databases. As a bug hunter and idea generator, Jeroen has contributed to many products such as Developer Express? Component Development Kit and Borland Delphi. In his free time, Jeroen plays percussion in a world-famous marching band. He also enjoys reading fine books and sampling foreign cuisines.
Image not available

[WayBack] GetPublished – Author Information

From the referencing pages:

Administrating and Configuring Linux for Kylix

Intermediate paper for Delphi programmers starting to use Linux. It explains how to use and integrate Linux and Kylix with Windows and Delphi.�

The Delphi Developer’s Guide to C#

As a Delphi developer, you will find C# easier to learn than you might have thought. Get a head start with this revealing presentation.�

Choosing COM, CORBA or SOAP: What Do they Share and What Sets them Apart

This session describes COM, CORBA and SOAP, indicating what they share, what sets them apart, and how you can choose among them.�

CASE STUDY: ReCruit — Matching and Administration for Recruitment

This session provides a demonstration of ReCruit, including a discussion of its development and deployment process. ReCruit was built using Delphi and InterBase.�

–jeroen

Posted in BorCon, C#, Conferences, Delphi, Development, Event, SOAP/WebServices, Software Development | Leave a Comment »

Which class memory management model would you prefer for Delphi?

Posted by jpluimers on 2018/01/31

An interesting discussion on ARC and classic memory management in Delphi and ideas on hybrid ways: [WayBack] Which class memory management model would you prefer for Delphi? Or better, which one would fit better for your needs? – Malcon X Portela – Google+

–jeroen

Posted in Delphi, Development, Software Development | 9 Comments »

As Delphi generics are not supported for free functions, wrap them in a record container.

Posted by jpluimers on 2018/01/31

Of the things not possible with generics in Delphi, I already wrote about Impossible: Property using Generics in Delphi.

Now it’s time to write about simulating a free function with generics as this is impossible:

function CreateManaged<T>(const value: T): IManaged<T>;

Usually I create a static record method for these, as records do not have VMT overhead, less RTTI overhead and I’ve been used to see records as helpers for other types long before helpers initially were introduced in Delphi 8 to extend classes..

Spring4D has an excellent example of such a record workaround in the Managed.New<T> commit:

type
  Managed = record
  public
    class function New<T>(const value: T): IManaged<T>; static;
  end;

...

class function Managed.New<T>(const value: T): IManaged<T>;
begin
  Result := TManaged<T>.Create(value);
end;

It basically is a factory for classes implementing the IManaged interface.

In the mean time, Managed has been renamed to Shared but the above code shows my point.

–jeroen

Reference: [WayBackClass Helpers documented in Delphi 2007, introduced in Delphi 8

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 5 Comments »

Delphi 2009 syntax; not official, but a great start and complement to DelphiAST

Posted by jpluimers on 2018/01/30

A while ago, I found out that [WayBackToon Krijthe made a [Archive.isDelphi 2009 syntax sample which is a great complement to the DelphiAST parser given that Borland/CodeGear/Embarcadero/Idera never published one in the 22+years that Delphi is alive.

–jeroen

Posted in Delphi, Delphi 2009, Development, Software Development | 6 Comments »

HTTP Protocol Related Improvements in Delphi 10.2.2

Posted by jpluimers on 2018/01/25

After years of (peer) pressure, Embarcadero finally did some client-side [WayBack] HTTP Protocol Related Improvements in Delphi 10.2.2.

The fixes add some features to THTTPClient that have been available in Indy since version 9 (which however requires 1.0.2 OpenSSL binaries support the required functionality):

We have added a new enumeration, THTTPSecureProtocol with the values (SSL2, SSL3, TLS1, TLS11, TLS12). THPPTClient and related classes have now a SecureProtocols property which is a set based on that enumeration.

References:

–jeroen

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

git repository by David Heffernan – sets environment variable DelphiProjectCompileMode to the build type

Posted by jpluimers on 2018/01/25

Interesting repository https://github.com/davidheff/DelphiProjectCompileMode in a response to

[WayBack] I’m trying to use Pre-/Post-Build-Events (Delphi 10.1 Berlin, if that matters). Is there a variable, parameter, option etc to distinguish between a “make” and a “build”… – Achim Kalwa – Google+

This requires an expert as Delphi doesn’t do it out of the box, so I was glad this expert solves that: davidheff/DelphiProjectCompileMode: Delphi IDE add in that sets an environment variable to indicate which compile mode (make, build, etc.) was used to start a compile action

It sets the DelphiProjectCompileMode variable to a value depending on the TOTACompileMode:

cmOTAMake -> Make
cmOTABuild -> Build
cmOTACheck -> Check
cmOTAMakeUnit -> MakeUnit
otherwise -> Unrecognised

–jeroen

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