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

Archive for the ‘Delphi’ Category

Tweaked TStringBuilder in FastCode is now 2x faster than the stock…

Posted by jpluimers on 2019/07/17

Reminder to self as occasionally I concatenate a lot of strings:

[WayBack] After some tweaking TStringBuilder in FastCode is now 2x faster than the stock Builder in SysUtils.  – Johan Bontes – Google+.

Source: FastCode/FastStringBuilder.pas at master · JBontes/FastCode

–jeroen

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

Delphi RTTI Context limitation: not thread safe for method RTTI

Posted by jpluimers on 2019/07/16

In a comment to [WayBack] Update: It was not clear what I was asking so I updated the question. I am trying to call RTTI Invoke from within TTask.Run and I get an AV. I have t… – John Kouraklis – Google+

… you can’t use a TRTTIMethod instance from a TRTTIContext of another thread….

John Kouraklis

+Eric Berger+Panagiotis Drivilas That’s it. Many Thanks

–jeroen

Posted in Delphi, Development, Software Development | 1 Comment »

Design Patterns & Refactoring

Posted by jpluimers on 2019/07/16

Design Patterns and Refactoring articles and guides. Design Patterns video tutorials for newbies. Simple descriptions and full source code examples in Java, C++, C#, PHP and Delphi.

Source: [WayBackDesign Patterns & Refactoring.

And indeed a lot of examples in Delphi too; few sites have that: Delphi site:sourcemaking.com.

–jeroen

Via: [WayBack] I stumbled upon this yesterday, very informative, accessible and also with Delphi examples – among other languages. – Steffen Nyeland – Google+

Posted in .NET, C, C#, C++, Delphi, Design Patterns, Development, Java, Java Platform, PHP, Scripting, Software Development | Leave a Comment »

Thread around DCEF3 leaking memory, but DCEF4 doesn’t taught me to look at madExcept for memory leak checking too

Posted by jpluimers on 2019/07/09

This thread about [WayBack] DCEF3 memory leak in Delphi XE2  – Alberto Paganini – Google+ taught me that madExcept has a much more elaborate memory leak checking than FastMM4: it checks any Windows memory heap allocation, handle leaks, etc, not just the Delphi code induced memory allocations.

Thanks David Heffernan for commenting this part:

The madExcept leak tracking tools are much more comprehensive than those of FastMM because have much greater coverage. FastMM’s leak tracking tools are great, but only track native Delphi allocations. With the madExcept tooling you get all heap allocations (including non-native ones), handle leaks etc.

That is not to belittle the FastMM tooling at all…

Time to again look at [WayBack] madshi.net – madExcept description

–jeroen

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

A COM Object Collection (IEnumVARIANT) – Delphi Tips – CJC Delphi (Cool Delphi Tips)

Posted by jpluimers on 2019/07/04

Summary of [WayBack] A COM Object Collection (IEnumVARIANT) – Delphi Tips – CJC Delphi (Cool Delphi Tips)

Question: How to implements object collection that support Visual Basic’s For Each construct ?

Answer:
In order to implements an object collection your object has to return  IEnumVariant pointer from a special property named _NewEnum.

Via: [WayBack] What interface to I need to implement to allow ForEach in VBA on a COM object written in delphi? – Stack Overflow

–jeroen

Posted in COM/DCOM/COM+, Delphi, Development, Software Development, Windows Development | Leave a Comment »

Delphi Galileo IDE (version 8 and up): Force files to be saved as UTF8 – The Oracle at Delphi

Posted by jpluimers on 2019/07/04

Though formatting mangled the registry key to add, the article is interesting: since 2003 (C# Builder 1), you can force the IDE to always save files as UTF8 which should alleviate a lot of encoding problems.

It beats me why this isn’t the default setting, but below is an example .reg file for Delphi 8 which should be easily transformed to more recent Delphi versions:


Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Borland\BDS\2.0\Editor]
"DefaultFileFilter"="Borland.FileFilter.UTF8ToUTF8"

So basically (if formatting is kept), you browse to this key (replace Borland with the company for your specific Delphi version, and replace 2.0 by your IDE version):

HKEY_CURRENT_USER\Software\Borland\BDS\16.0\Editor

Then you add a new string value named DefaultFileFilter with value Borland.FileFilter.UTF8ToUTF8

More background [WayBack] The Oracle at Delphi: More IDE secrets – UTF8 and the Editor

The unmangled registry key (and more tips) was from [WayBackBSC Polska: Hidden possibilities of Delphi 8.

Get the list of HKEY_CURRENT_USER paths for your Delphi version at Update to List-Delphi-Installed-Packages.ps1 shows HKCU/HKLM keys and doesn’t truncated fields any more.

–jeroen

Via: [WayBack] Is there any way (IDE expert?) to automatic set encoding of each PAS file in UTF-8 instead of ANSI? – Jacek Laskowski – Google+

Posted in Delphi, Development, Encoding, Software Development, UTF-8, UTF8 | 1 Comment »

[dcc32 Warning] “W1025 Unsupported language feature: ‘operator explicit'”

Posted by jpluimers on 2019/07/03

If the Delphi compiler throws a Source: "W1025 Unsupported language feature: 'operator explicit'" at you, then it is likely that you forgot this, as per Uwe Raabe:

In the project options set “C/C++ Output file generation” to “Generate DCUs only” to get rid of the warning.

Via: [WayBack] Delphi Community Edition Rant. Just installed Delphi CE from the 3rd attempt. Two times I tried to install all features – both times the installer fell… – Sergey Kasandrov – Google+

Note that the documentation still indicates that W1025 has been documented since at least Delphi 2007 ([WayBack] x1025: Unsupported language feature: ‘%s’) as a C++ header translation issue, and still is ([WayBack] X1025 Unsupported language feature: ‘%s’ (Delphi) – RAD Studio), despite other causes (like "W1025 Unsupported language feature: 'custom attribute'") fail if you have only installed the Delphi personality.

–jeroen

Posted in Delphi, Development, Software Development | 1 Comment »

[RSP-19007] Form ScaleConstraints Fail – Embarcadero Technologies

Posted by jpluimers on 2019/07/02

[WayBack] [RSP-19007] Form ScaleConstraints Fail – Embarcadero Technologies

Via [WayBack] +Uwe Raabe Did Embarcadero fix TControl.ScaleConstraints() in the latest version? Do you have a patch for that? Simply changing the properties Min* agai… – Attila Kovacs – Google+

Fix: [WayBackpisil.de/Patch.ScaleConstraints.pas 

// Workaround for TControl.ScaleConstraints bug
// Usage:
// Put "PatchScaleConstraints;" into the dpr right after "Application.Initialize;"

–jeroen

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

Interesting thread on how to approach Hi-DPI and DPI changes with FMX in Delphi

Posted by jpluimers on 2019/07/02

Interesting read: [WayBack] Is there an “How-To Guide: Upgrading Your Delphi FMX Applications To Support 4K Displays” out there ? I’ve only found VCL examples… – Stéphane Wierzbicki – Google+

–jeroen

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

SequoiaView Homepage

Posted by jpluimers on 2019/07/01

I thought I had scheduled a blog post about the great tool on [WayBackSequoiaView Homepage, but didn’t. In the mean time, Paolo Buffa posted an overview with a really nice historic perspective:

Is amazing from how many years I’m using this program, and how many operating systems it managed to go thru almost unscathed, without modification.

Paolo Buffa

Source: [Archive.is] SequoiaView: a piece of history. – Data Center IT – Spiceworks

I still use it, despite it being quite old: 2002 era, written in Delphi 5. It’s beautiful in part because of its anciency, but also because it is so simple and intuitive that I still use it regularly.

The age also shows in the web page (which when writing it was still on-line): The SequiaView home page link above is actually a classic frame inside [WayBackThe SequoiaView Homepage. Back then, it was already starting to be considered obsolete to write HTML using frameset [WayBackFraming (World Wide Web) – Wikipedia.

The SequoiaView [WayBack] Download Page even points to non-existing ftp-download URLs via counter CGI scripts:

None of them have been archived by the WayBack machine: https://web.archive.org/web//ftp://ftp.win.tue.nl/pub/home/sequoia//

To verify alternative downloads, just check these hashes:

hash command filename hash output
$ md5 Sequoia1.3Install.zip MD5 (Sequoia1.3Install.zip) = 28d356f2bafe258805794257c284a075
$ md5 Sequoia1_3XPInstall.exe MD5 (Sequoia1_3XPInstall.exe) = 142586a5cc7a0139bde8c13e5cc4d301
$ shasum Sequoia1.3Install.zip 762ab30177a7f6a0d4f173fd2442ba7b61df4c2e Sequoia1.3Install.zip
$ shasum Sequoia1_3XPInstall.exe c1db10a0f7d36adbc14b5a7a3f08fc35db1bee8b Sequoia1_3XPInstall.exe

I’ve a copy in my archive that I just use in a portable way: just copy over SequoiaView directory with these files in it:

  • Archives.col
  • DEFAULT.COL
  • Images.col
  • License.txt
  • Movies.col
  • ReleaseNotes.txt
  • Sequoia.cnt
  • Sequoia.exe
  • SEQUOIA.HLP
  • Sound.col

You can download this from gist.github.com/jpluimers/b0df9c2dba49010454ca6df406bc5f3d (ef94f1875377f4054e3a434f8942e1749f0af74a.zip).

A few things that could be fixed (if ever hopefully MagnaView open sources it: [WayBack] @jpluimers More @magnaview did you ever consider to open source the Delphi code for http://www.win.tue.nl/sequoiaview/ or give someone NDA access to fix some bugs?):

  • Access violation when re-scanning a drive
  • Option to show multiple links to the same physical file
  • Indication of more rights  needed to index a file or directory
  • Better explorer integration (via context menu)

Read the rest of this entry »

Posted in Delphi, Delphi 5, Development, Power User, Software Development, Windows | Leave a Comment »