January 2015

Modernize you Delphi Windows application: use Windows 2000 (and later!) services.

No, the title of this blog post is not a mistake. Delphi, including XE7, only implements services using NT APIs obsoleted since Windows 2000. Windows NT was EOLed in 2004, 2000 in 2010, and XP last year, yet Delphi still doesn't take advantage of the new APIs. What are the advantages? Well, using the "extended" RegisterServiceCtrlHandlerEx() and its HandlerEx() callback, services can receive more and useful notifications (control codes). The new control codes allow to be notified of and handle:

Laughable 64KB (!) limit in Delphi RTTI

Today a colleague of mine was trying to import VMWare 5.5 WSDL into Delphi. When he tried to compile the application, it got:

[DCC Error] vimService.pas(60427): E2575 RTTI for 'VimPortType' is too large; reduce scope with $RTTI or
reduce type size

Delphi Doc Wiki says (XE7 too):

This occurs when the generated RTTI is too large (greater than 64kB).