Donations for GExperts keep coming in. It’s more a trickle than a flood but hey, I’m not in it for the money. And please remember that I prefer other kinds of contributions over money.

I have used that money in turn for donations to

I would have liked to also donate to PuTTY and FileZilla but I found no way to do it.

(Yes, there is a donate link on the FileZilla SourceForge page but it doesn’t work.)

The method of changing the order of the TabSheets in a PageControl in Delphi is not obvious. Apparently there is no drag and drop support (at least not in Delphi 2007). You have to change the PageIndex property. So, if you want to insert a new page, add it and then change its PageIndex to the insert position.

I smell an opportunity for a new GExperts Expert. Any takers?

EDIT: As Moreno Zenaro pointed out in a comment to my Google+ post, there is actually a GUI way of changing the order: Drag the TabSheet in the structure view.

As I stated before I prefer good bug reports on GExperts over money any time. Philip von Melle kept testing and providing feedback even after I thought the issue was already solved.

The issue was that a Macro Template

(%SELECTION)


used on this code

// öäüß

procedure TForm1.FormCreate(Sender: TObject);
begin
ShowMessage('TEST');
end;


while TEST was selected
generated code like this

// öäüß

procedure TForm1.FormCreate(Sender: TObject);
begin
ShowMessage(''); (TEST)
end;


The reason again was improper use of positions and offsets into the editor buffer in conjunction with some Unicode characters above the code. So the insert position was calculated by 4 bytes too high, hence the macro code was inserted 4 characters behind the start of the original selection.

Note to self: Do not use a watch entry like this while debugging GExperts:

GxOtaReadEditorTextToString(GxOtaGetEditReaderForSourceEditor(nil))


While this might seem very convenient it will sooner or later corrupt the current edit buffer or do something even worse, because, as a comment in ToolsApi states:

WARNING!!!
A IOTAEditReader should never be active at the same time as an IOTAEditWriter.

But having it as a disabled entry in the watch window, enable it to inspect the current content of the edit buffer, before disabling it again can be very useful.

GExperts so far comes with a special stand alone executable GExpertsGrep that does nothing else but load the GExperts dll and call the entry point ShowGrep. Having this additional executable isn’t really necessary because Windows already comes with a tool that does exactly that: Load a DLL and call an entry point: rundll32.exe

rundll32 path\to\your.dll,EntryPoint additional parameters go here


In order for a dll to be called in this manner it needs to export an entry point with the following definition:

procedure EntryPoint(_HWnd: HWND; _HInstance: HINST; _CmdLine: PAnsiChar; CmdShow: integer); stdcall;


Note that the calling convention must be stdcall otherwise bad things happen.

Since Windows NT (so for all modern versions of Windows) there are two additional ways to declare the entry point:

procedure EntryPointA(_HWnd: HWND; _HInstance: HINST; _CmdLine: PAnsiChar; CmdShow: integer); stdcall;
procedure EntryPointW(_HWnd: HWND; _HInstance: HINST; _CmdLine: PWideChar; CmdShow: integer); stdcall;


Note that EntryPoint and EntryPointA are still assumed to have a PAnsiChar parameter, while EntryPointW is assumed to have a PWideChar parameter. A Dll only needs to export one of these entry points.

If RunDll32 is called with “EntryPoint”, it will look for “EntryPointW” first, “EntryPointA” second and “EntryPoint” last. Note that you don’t have to specify the “A” or “W” suffix, it is automatically added by RunDll32.

For a change, we even have an advantage when writing the DLL in Delphi rather than in MS Visual C++: Delphi does not do any name mangling, so the entry point will be called exactly what you write in the source code.

So, assuming the GExperts DLL exports the following procedure:

procedure ShowGrepEx(_HWnd: HWND; _HInstance: HINST; _CmdLine: PAnsiChar; CmdShow: integer); stdcall;


RunDll32 could be called like this:

rundll32 path\to\GExperts.dll,ShowGrepEx Some\Directory\here


The DLL would take the _CmdLine parameter, use it as the base directory for a directory search and show you the dialog as above. Pretty cool, eh?

We could even go a step further and write the following to the registry to add an entry to the context menu of each folder in Windows Explorer.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\GExpertsGrep]
"Icon"="path\\to\\GExperts.dll"
"MUIVerb"="GExperts Grep"

[HKEY_CLASSES_ROOT\Folder\shell\GExpertsGrep\Command]
@="\"c:\\windows\\system32\\rundll32.exe\" path\\to\\GExperts.dll,ShowGrepEx %1"


(Note: Don’t just copy that to a .reg file! You need to replace both instances of “path\\to\\GExperts.dll” with the actual absolute path to your GExperts DLL. And don’t forget that the current release does not even export the entry point ShowGrepEx at all.)

And this is what you’d get:

Unfortunately there is a drawback: RunDll32 must be given the correct path and file name of the DLL to load. That’s fine if you only have one GExperts version installed. The current GExpertsGrep stand alone executable searches for the first GExperts DLL in descending order, so it will always load the one for the latest Delphi version it can find. So I am not sure whether I want to drop the stand alone executable in favor of RunDLL32 right now.

Various people have reported an error message regarding rtl240.bpl not being found when calling the stand alone version of GExperts Grep. I could never reproduce it but my recent insight on SaveLoadLibrary now also solved that one:

The stand alone version of GExperts Grep tries to load any GExperts dll, regardless which version. The idea being that I don’t have to maintain multiple versions of the executable just to load the dll which does all the work anyway. So it tries to load the dlls in descending order, starting with the latest Delphi 10.1 (Berlin) one (I added 10.2 yesterday). But since GExperts is an IDE expert and therefore needs to use the rtl and various other packages, it of course requires them even if it is being used stand alone. And if you for whatever reason have GExperts installed for a Delphi version which you don’t have installed (or for which the packages are not in the search path), it fails to load and the error dialog described in the linked article was displayed.

It no longer does, thanks to David Heffernan’s hint.

There is no new release yet, not sure when I will have one ready.

Jeroen Wiert Pluimers has notified me in his comment on Google+ that the RSS feed for GExperts related posts doesn’t work. I apparently forgot a forward slash in the url:

correct:

http://blog.dummzeuch.de/category/gexperts/feed/

wrong:
http://blog.dummzeuch.de/category/gexpertsfeed/

It’s fixed now, sorry about that.

I have been asked to provide GExperts for Delphi 10.2 Tokyo, multiple times, via various channels.

Apparently not everybody subscribed to the GExperts Community on Google+, where I posted this on 2017-04-01:

No April fools’ joke: GExperts 1.38 experimental 2017-04-01 for Delphi 10.2.

This version should solve several bugs that resulted in Access Violations in the IDE or made the IDE hang.

Again: This is not for the faint of heart. It is barely tested. Download only if you promise not to blame me for the work you lost.

Please report any bugs on sourceforge https://sourceforge.net/p/gexperts/bugs/

There seem to be multiple download links on the web for GExperts for Delphi 10.2 Tokyo that want to charge for a “VIP membership”. These have not been authorized by me at all.

To those who already downloaded it back then: This is still the same version. I have started working on a major change in the way dialog changes and bugfixes are handled internally, which currently is a mess. That change is far from finished, so it doesn’t make much sense to build a new installer right now.

Two weeks ago I added the Donations for GExperts page. A few days later I received the first money through PayPal. Thanks for that!

I have now used that credit for donations to other open source software that I use daily:

I had always wanted to donate to those projects but never came around actually doing that. So, having some ready to use credits on PayPal made me finally do it.

If you want to say thank you for my work on GExperts, there are the following options:

Contribute to the GExperts quality
You can either contribute good bug reports or – even better – bug fixes to GExperts. I’d actually prefer that over getting money. Good bug reports include the Delphi version (and language), the Windows version, the GExperts version, the settings used and steps to reliably reproduce the problem. Screen shots might also help. Use the bug report form on Sourceforge for that.

You can do even more by taking over the maintenance of GExperts for a particular Delphi version. I am currently using Delphi 2007 for most of my work, with a bit of Delphi XE2 and the latest version sprinkled in. So most of the other versions don’t really get tested. If you regularly use e.g. Delphi 6, 7, 2005, 2006, 2009 or 2010, why not take over testing and possibly bug fixing GExperts for these versions? For now, I still have working installations of these Delphi versions, but I am not sure that I will go to much effort to keep them working in the future. If one of them breaks, I might decide to drop GExperts support for them. By taking on the responsibility for them, you ensure they will still be around in a few years.

Contribute new features to GExperts
Contributing features to GExperts involves more than just suggestions (even though I am open to these too, please use the feature requests form page on SourceForge for that.)

It’s also not only about implementing them and sending me patches. It’s about thinking about how to integrate them into the existing code and UI. If you want to contribute code, please feel free to contact me.

Donate money
If you can’t do any of the above, you can donate money. I suggest the following amounts:

• 50 Euros per year for private use via or
• 100 Euros per developer per year for commercial use via or

It’s up to you of course. If you think it’s worth more, I definitely won’t complain, but if you can’t afford these, smaller amounts are also OK.