dzEditorLinendsFix 1.0.4 released

 Delphi  Comments Off on dzEditorLinendsFix 1.0.4 released
Mar 232019
 

This is nothing to write home about, really, just a small change:

Previously when starting the tool, the main window was shown for a short time before it got hidden. Now that no longer happens.

Don’t now what this is about? You are probably lucky then and don’t need this tool. But if you still want to know, go to the dzEditorLinenedsFix page.

 Posted by on 2019-03-23 at 11:43

GnuGetText.pas using Utf8ToUnicodeString instead of Utf8ToWideString

 Delphi  Comments Off on GnuGetText.pas using Utf8ToUnicodeString instead of Utf8ToWideString
Mar 092019
 

A few weeks ago, Sue King contacted me because there was a problem with using dxGetText together with the Nexus DB components.

For Unicode aware Delphi versions gnugettext.pas declares a function utf8decode which calls System.UTF8ToWideString. After replacing a call to utf8decode with UTF8ToUnicodeString the problem went away.

Since I don’t want to break backwards compatibility with non Unicode Delphi versions I have now changed gnugettext.utf8decode to call UTF8ToUnicodeString instead of UTF8ToWideString.

I can’t see any problem with this change but I am far from being an expert on Unicode related issues. So, if you find any problem with this change, please comment on the corresponding topic in the international Delphi Praxis forum.

 Posted by on 2019-03-09 at 14:11

GExperts Grep can use the MAP file

 Delphi, GExperts  Comments Off on GExperts Grep can use the MAP file
Mar 032019
 

The GExperts Grep Search expert has various options to tell it which files to search:

  • The current file
  • All files in project
  • All files in project group
  • A directory list (separated by semicolon)

That sounds like an exhaustive list, but it isn’t. Both, project and project group, were only searching files explicitly listed in the project(s). Files that were linked into the project using the search path, were not searched.

Until now, that is: There is now an option to use the MAP file instead of the DPR file for project search.

The MAP file is created by the linker and contains a list of all source files linked into the program. By default, that file is not created though, you must explicitly enable it on the Linker page of the project options.

The least detailed setting “Segments” is sufficient for the new Grep functionality. If there is no MAP file, it falls back to the original method of searching files listed in the DPR file.

Beware that this will also search units located in the RTL / VCL and FMX source directories. This might not be what you want. I plan to add some more flexibility in the future.

There is no release yet and it might take a while until I feel like doing one, but you can always compile your own GExperts DLL. Make sure you delete the existing directory AppData\roaming\GExperts\DelphiXXX\UsesExpertCache when you replace the DLL with the new one.

Discussion about this post at https://en.delphipraxis.net/topic/793-gexperts-grep-can-use-the-map-file/

 Posted by on 2019-03-03 at 12:19

GExperts error: PrivateGXMenuActionManager is not nil upon creation

 Delphi, GExperts  Comments Off on GExperts error: PrivateGXMenuActionManager is not nil upon creation
Mar 012019
 

If you get the error “PrivateGXMenuActionManager is not nil upon creation” when starting your IDE, check the entries under

HKCU\Software\Embarcadero\BDS\<version>\Expert

There are most likely two entries for GExperts. Remove one and the error should go away.

These entries come from

  1. The installer (GExperts=”path\to\dll”), because it always uses GExperts as the name for the entry.
  2. The Expert Manager (GExpertsXxx=”path\to\dll”), because it uses the name of the dll file for the entry.

Yes, this is a bug. And it has been fixed on 2019-03-02.

Discussion about this post here: https://en.delphipraxis.net/topic/785-gexperts-error-privategxmenuactionmanager-is-not-nil-upon-creation/

 Posted by on 2019-03-01 at 10:34

Finding GUIDs with GExperts Grep

 Delphi, GExperts  Comments Off on Finding GUIDs with GExperts Grep
Feb 162019
 

I recently had a problem with access violations when calling methods of interfaces. The reason turned out to be duplicate GUIDs in the interface declarations. This caused AVs because the wrong methods were called and the parameters passed to them were not of the right type and numbers. Duplicate GUIDs are usually caused by copying existing interfaces and changing them, without also generating a GUID for the copy. (Btw: The Hotkey for generating a new GUID in the Delphi IDE is Ctrl+Shift+G.)

So I looked for a way to find all interfaces and their GUIDs in my program. There is a uInterfaces.Duplicates unit on GitHub which claims to retrieve this list. Unfortunately I needed this for a Delphi 2007 program and Delphi 2007 does not come with a System.RTTI unit, so this was not an option (and therefore I don’t know whether this unit would have worked).

StackOverflow didn’t help much either, apart from David Heffernan’s suggestion to parse the source code.

So this is what I did. I used GExperts Grep to search for GUIDs, or more eaxct: For the pattern that is used to add a GUID to an interface declaration in Delphi.

It always looks like this:

type
  ISomeInterface = interface ['{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'];

Where X is a hexadecimal digit in upper case.

The Regular Expression for this is:

\['\{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\}'\]

The literals [ ] and { } must be escaped with a backslash because they have special meaning in a RegEx. [0-9A-F] means one of ‘0’..’9′ or ‘A’..’F’ which is an upper case hexadecimal digit. {4} means four of those {8} means eight and of course {12} means twelve.

You have to turn off the option “Whole Word” and turn on “Regular Expression”. Of course this needs to search at least all files in the project.

Why do I say “at least”? Because actually it needs to search all files linked into the project, including any packages if such are used. “All files in project” only searches files listed in the DPR file, so it’s potentially missing quite a lot.

Which, again, reminds me that I wanted to extend Grep Search to search all files in the MAP file. Code for getting that list is already in place and being used e.g. in the Open File Expert. I “just” need to put the pieces together.

I’m thinking about making yet another Expert out of this, that not only lists all GUIDs but shows a list of Interface names and their associated GUIDs and of course checks for duplicates.

Discussion about this post in the international Delphi Praxis forum.

 Posted by on 2019-02-16 at 12:28

Delphi Blogs

 Delphi  Comments Off on Delphi Blogs
Feb 102019
 

The Delphi Wiki has a list of “Useful Sites” which has a sub section for Delphi Blogs.

I have just further divided that section into:

  • Active Blogs, which contains blogs that are active
  • Intensive Care Unit, which contains blogs that are still available but have been inactive for more than a year
  • Cemetery, which contains blogs that are dead, so I have changed the link to point to the last snapshot in the Internet Archive.

If you find your blog in one of the later ones and it is still active (maybe moved to a new url), feel free to edit the page again. It’s a Wiki after all.

I have also added the
Delphi Praxis international developer community and the new
Embarcadero Discussion Forum (Delphi) to the list of Web Based Forums and removed some outdated links.

 Posted by on 2019-02-10 at 15:53

Two GExperts bugs fixed, 14 to go

 Delphi, GExperts  Comments Off on Two GExperts bugs fixed, 14 to go
Feb 092019
 

I just fixed two (newly reported) bugs in GExperts:

  1. The Set Tab Order dialog no longer worked in Delphi 6, 7 and 2005. This was due to me adding AlignWithMargins (and the associated Margins property) to the dfm file. This property apparently was introduced in Delphi 2006. Again, this underlines what I mentioned several times: I do not use Delphi < 2007 for anything but testing and fixing bugs GExperts. That’s why glitches like this tend to slip by unnoticed. That’s why I would like people to volunteer for testing the various versions. But apparently nobody can be bothered. Fine by me, but you will have to live with the consequences. I don’t have a QA department.
  2. The extensions to the Uses Clause Manager caused several thousand (small) files to be created in the GExperts configuration directory. This directory is located under AppData\roaming\GExperts which means it will be copied when roaming profiles are enabledin a Windows domain. I didn’t know that anybody still uses roaming profiles since they are usually not worth the trouble, but apparently they are still being used. So I now moved that cache to AppData\local and also added a config option to disable caching altogether.

There are now 14 open bug reports on SourceForge. But if you encounter more, please do report them there!

There is no release yet and it might take a while until I feel like doing one, but you can always compile your own GExperts DLL. Make sure you delete the existing directory AppData\roaming\GExperts\DelphiXXX\UsesExpertCache when you replace the DLL with the new one.

btw: Did you notice that I have added menus to my blog?

Discussion about this post in the international Delphi Praxis forum.

 Posted by on 2019-02-09 at 17:22

Sie wollen mich einstellen?

 Delphi  Comments Off on Sie wollen mich einstellen?
Jan 272019
 

Derzeit habe ich eine unbefristete Vollzeitstelle (40h) als Leiter der Softwareentwicklung bei der TÜV Rheinland Schniering GmbH. Ich bin damit ganz zufrieden und suche nicht aktiv nach einer neuen Stelle.

Da ich aber immer wieder mal gefragt werde, ob ich an einem Angebot Interesse habe, stelle ich hier auf, was man mir bieten müsste, damit ich über einen Wechsel nachdenke.

 Posted by on 2019-01-27 at 15:24