How can I simulate ‘Send To…’ with Delphi?

Default mail client with selected files auto-attached The following code is based on these two articles: Dateien von der eigenen Anwendung per Drag and Drop zum Windows Explorer kopieren? Programmatically use the SendTo mail recipient shortcut Drop a FileListBox and a button on a form and set the FileListBox MultiSelect property to true. Use this … Continue reading How can I simulate ‘Send To…’ with Delphi?

Why 1.99 suddenly no longer equals 1.99

A strange problem suddenly occurs in all my Delphi 7 and Delphi 2009 unit tests. I used DUnit CheckEquals to compare two Currency values, like [sourcecode language="pascal"] CheckEquals(1.99, SomeCurrencyValue) [/sourcecode] This worked fine in the IDE and in our build scripts, which run using the same version of DUnit for two years. Now, all of … Continue reading Why 1.99 suddenly no longer equals 1.99

Why is “Self” assignable in Delphi?

This code in a GUI application compiles and runs (tested with Delphi 6 and 2009): procedure TForm1.Button1Click(Sender: TObject); begin Self := TForm1.Create(Owner); end; Questions that come to mind: why is Self writeable and not read-only? in which situations could this be useful? If you know the answer, I would be happy if you post it … Continue reading Why is “Self” assignable in Delphi?