NativeInt / NativeUInt type in various Delphi versions

Just in case you are maintaining Delphi code for several older versions of Delphi: Be aware that the declarations of NativeInt and NativeUInt are wrong in some of them. Delphi versionSizeOf(Native(U)Int) Win32SizeOf(Native(U)Int) Win64 1 to 6not availablenot available 7 to 20078 ← this is wrongnot available 2009 to XE4not available XE2 to XE848 10.x48 I … Continue reading NativeInt / NativeUInt type in various Delphi versions

If your floating point calculations differ after a trivial change

Today I had a curious bug: After changing the way GPS coordinates were read from a file (not calculated!) all of a sudden lots of unrelated floating point calculations had different results. I reverted the changes just to be sure and, yes, the results were back to the original values. I added the new code … Continue reading If your floating point calculations differ after a trivial change

Enable debug logging in gnugettext.pas

gnugettext.pas has got a conditional define called DXGETTEXTDEBUG. If it is defined, various debug messages are written to a MemoryStream. That won't help much, if you can't read that stream, so you need a way to write that stream to a file. Guess what, that's easily possible. Just call DefaultInstance.DebugLogToFile passing it a file name … Continue reading Enable debug logging in gnugettext.pas

GNUGetText support for the GExperts Message Dialog expert

Based on an idea and partial implementation submitted by Sven Harazim from Landrix Software I have just added support for GNUGetText to the GExperts Message Dialog expert. It now looks like this: And generates Code like this: [delphi] MessageDlg(_('first line'+#13#10+'second line'), mtWarning, [mbOK], 0); [/delphi] Or, if you'd rather use the Windows API: which generates … Continue reading GNUGetText support for the GExperts Message Dialog expert

Delphi disabled packages in the registry

Note to self: The Delphi IDE stores a list of disabled packages (that is packages where the user removed the check mark in front of the package under Components -> Packages) in the registry under HKCU\<basekey>disabled packages. <basekey> is the base key of the Delphi configuration, e.g. Software\Embarcadero\BDS\9.0 So the disabled packages for Delphi XE2 … Continue reading Delphi disabled packages in the registry