@Akira, @Engkin and @SergeA heartfelt thank you to the three of you for your efforts to solve the problem. This solution saves me a lot of time and hassle.

Engkin, Serge... my hat off to you guys. I owe you one.
For anyone who might benefit from seeing "applicability", I attached a small program that works with Delphi 2, Delphi 10 and FPC in 32 and 64bit.