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

Archive for the ‘Delphi’ Category

When the Delphi IDE gets slow…

Posted by jpluimers on 2019/10/24

A few tips for when the Delphi IDE gets slow, try these step by step:

  1. Install Delphi Fix-Pack by Andreas Hausladen (a.k.a. Andy)
  2. Disable “Error Insight”
  3. Disable or install LiveBindings related packages

The first can be hard to find as his site disallows search engine indexing, but I’ve written about it before site:wiert.me delphi fixpack andy.

The second step is not a package, but an IDE setting:

The last step involves packages like these (package path followed by package description in the order of the registry):

$(BDSBIN)\dclBindCompFireDAC220.bpl            LiveBinding Expression Components FireDac
$(BDSBIN)\dclbindcomp220.bpl                   Embarcadero LiveBindings Components
$(BDSBIN)\dclbindcompvcl220.bpl                Embarcadero LiveBindings Components VCL
$(BDSBIN)\dclbindcompdbx220.bpl                LiveBindings Expression Components DbExpress
$(BDSBIN)\dclbindcompfmx220.bpl                Embarcadero LiveBindings Components FireMonkey

In those, $(BDSBIN) and $(BDS)\Bin point to the same directory.

Parts via: [WayBack] EDIT: Pretty sure Fix-Pack solved the speed issue, as I installed it and things started flying. I was trying to be as stock as possible, in order to und… – Vin Colgin – Google+

–jeroen

 

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

Spring4D and factory – for my link archive

Posted by jpluimers on 2019/10/23

So I remember as resolving container things can be tricky:

–jeroen

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

Reminder to self: check progress on Delphi helper requests

Posted by jpluimers on 2019/10/23

One of the things the Delphi language really could use some updates in is helpers.

A semi-random example is in [WayBack… It nags me that I can’t create a record helper for a generic type… – Lars Fosdal – Google+.

So I wonder if there has been any progress, and this is a post to remind me checking it out.

Example feature requests (no more QC, so these have to do) by Horácio Filho:

–jeroen

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

DelphiSpringTrees – Trees in Spring4D

Posted by jpluimers on 2019/10/22

From a while back: [WayBack] I just commited a version of (my suggestion for) DelphiSpringTrees; this is the first version that I’m happy with. Features: – Fast – Does not use or … – Johan Bontes – Google+

The repository for “DelphiSpringTrees – Trees in Spring4D” is at https://github.com/jpluimers/DelphiSpringTrees

–jeroen

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

The Delphi System.Exit “Function”

Posted by jpluimers on 2019/10/17

Still wrongly documented as System.Exit Function [WayBack], most people think it is a statement.

However, it is a compiler intrinsic procedure in the System unit that – when called inside a real function – optionally accepts a parameter with the same type as the encompassing function because it is a compiler intrinsic. It kind of acts as an overloaded procedure, but in fact translate to machine code via an intermediate parse tree.

The parameterless version has been there since at least Turbo Pascal 3.0, but the parameterised version is more recent: I think it was introduced around Delphi 7.

It then stops executing that function after first executing any explicit or implicit finally blocks.

I’ve seen various projects that used their own Exit procedure. This is a very bad habit: Since the System unit is always further away in scope, the introduced one is called which can severely confuse programmers not being aware of this.

The code generation for the parameterless and parameterised  “overloads” of System.Exit is slightly different:

  • The parameterless one can often be optimised away, for instance folding multiple calls to them into one, or rearranging code execution so a jump isn’t needed any more. This means you cannot always put a breakpoint on them.
  • The parameterised one always needs code to load the function result, so you can always put a breakpoint on them.

Stefan Glienke explained the above in [WayBack] The advantage of using Exit() instead of a plain Exit? You can place a breakpoint! – Uwe Raabe – Google+

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 1 Comment »

delphi – How to set form height larger than 1096 pixels? (or width > 1620 pixels)- Stack Overflow

Posted by jpluimers on 2019/10/16

Delphi will limit [WayBackHeight or [WayBack] Width of a form in the designer based on the current Windows limitations, not on what your target users might.

See [WayBack] delphi – How to set form height larger than 1096 pixels? – Stack Overflow:

The reason for this behavior is that when you do not set constraints for the form size, Delphi will automatically get constraints at system level via the [WayBackWM_GETMINMAXINFO message, which is fired when…

Solution is to configure the [WayBack] Constraints property by setting either [WayBackConstraints.MaxHeight or [WayBackConstraints.MaxWidth.

Via: [WayBack] Since I put up 10.2, I cannot get a form width >1620. Whenever I enter a greater value, the system changes it back! As I have some programmes with comp… – erik wilson – Google+

–jeroen

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

Some Delphi settings require you to run with an Administrative UAC token

Posted by jpluimers on 2019/10/16

Though user-defined Code Templates live under %UserProfile%\Documents\Embarcadero\Studio\code_templates\Delphi, the stock ones (standard ones shipping with Delphi) ones do not: they live under %ProgramFiles(x86)%\x\Studio\y.0\ObjRepos\en\Code_Templates.

Above, x usually is Embarcadero, and y is your Galileo version number; see for instance Update to List-Delphi-Installed-Packages.ps1 shows HKCU/HKLM keys and doesn’t truncated fields any more.

Unlike user registry settings, which are copied from HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER, the stock Code Templates are not.

This means that if you want to change the stock Live Templates (for instance disable them) from the IDE, or from the Windows Explorer, you need to run them with an UAC token to elevate them to Administrator level permissions.

Oh, did you notice the consistency between code_templates and Code_Templates? Delphi is full of these consistency surprises**

via: [WayBack] EDIT…..ANSWER: Right-click and run Delphi IDE as “Run as Admin”.. remove the template. Start IDE normally. .. IMHO, you shouldn’t have to do this… – Vin Colgin – Google+ who commented:

Vin Colgin:
+Uwe Raabe yes. Imho. Delphi should use a UAC helper app to change things that need elevated permissions… just like we all have been doing with shipping software since Windows Vista. But nobody asked me. Imho.

as a response to

Uwe Raabe:
Usually you don’t have access rights to Program Files where the standard code templates live. Therefore you cannot remove any of these from inside the IDE. Either adjust the behavior to your needs (that will make a copy) or remove it from $(BDS) with admin rights.

** Some more consistency examples:

Just pick a few functions from these or more recent Delphi versions:

For example (there are many more):

Read the rest of this entry »

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

“Use TXSxxxx classes for simple nillable types”

Posted by jpluimers on 2019/10/08

For my link archive:

The first one missed these:

Both find these:

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, SOAP/WebServices, Software Development | Leave a Comment »

How to properly cleanup/shutdown a Delphi ISAPI (which uses Threads) | Mathias Pannier programmiert

Posted by jpluimers on 2019/10/03

For my link archive:

If you use Threads or global Objects (which are created in the initialization section for example) You have to cleanup/shutdown them in the OnTerminate event of the ISAPI Application. If You destroy/shutdown them in the finalization section in a unit it could end up in a hanging application pool in IIS on shutdown/reuse and some windows event log entries.

//added
procedure DoTerminate;
begin
  //free global objects and wait/terminate threads here
end;
exports
  GetExtensionVersion,
  HttpExtensionProc,
  TerminateExtension;
begin
  ReportMemoryLeaksOnShutdown := true;
  CoInitFlags := COINIT_MULTITHREADED;
  Application.Initialize;
  Application.WebModuleClass := WebModuleClass;
  TISAPIApplication(Application).OnTerminate := DoTerminate; //added
  Application.Run;
end.

Source [WayBack] How to properly cleanup/shutdown a Delphi ISAPI (which uses Threads) | Mathias Pannier programmiert

Related:

–jeroen

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

Delphi; on my research list `Error creating form: Root class not found: “”.`

Posted by jpluimers on 2019/10/03

On my Delphi research list:

[Window Title]
Error

[Content]
Error creating form: Root class not found: "".

[OK]

I think it has to do with form inheritance, but a quick glance didn’t raise any warning signs.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 1 Comment »