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

Archive for the ‘Delphi 2005’ Category

The curse of the Project.res file.

Posted by jpluimers on 2016/11/29

A long time ago, Lars Fosdal wrote this on the Delphi G+ group:

It really is beyond me why there is no Project.rc file which includes

  • Project.version.rc
  • Project.icon.rc
  • Project.themes.rc
  • Project.manifest.xml
  • and so forth.

That way, the .res file would be a compile-time thing (or even a thing of the past) – and the resource linker would assemble the various bits from their individual sources.

It has been an issue forever. Vincent Parrett correctly commented that if you clean out too much out of the Project.res file, the IDE gets confused:

The only thing it is used for is version info and the mainicon (the IDE gets confused if don’t do that).

In my own experience, this isn’t the case for all Delphi versions, but I forgot which versions suffer and which don’t. I think the IDE theming issue omitting the Application word in the .dpr is related.

Like many of the G+ commenters, I’ve switched to script based resources for my own projects a long time ago. That’s also the reason why I forgot: this approach just works for any Delphi version.

This post is a reminder to self to see if the IDE has finally refrained from doing Project.res handling itself.

–jeroen

Source: The curse of the Project.res file…

Some related posts:

Posted in Delphi, Delphi 1, Delphi 10 Seattle, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 5 Comments »

Delphi version info table: C# Builder, Delphi 8 through 10.3 Rio and Appbuilder

Posted by jpluimers on 2016/09/06

I’ve published the Delphi version info table as a Gist: https://gist.github.com/jpluimers/b5891600b73642788b492393710c6070.

Note I need help with these:

The updated script that forms the base of this table is here: https://bitbucket.org/jeroenp/wiert.me/src/tip/Native/Delphi/Scripts/List-Delphi-Installed-Packages.ps1

You can pass any of these args to get information

  • Individual columns:
    • CompanyNames, Versions, ProductNames, ProductVersions, BetaNames. ReleaseDates, Architectures, CharacterSets, Defines, CompilerVersions, RTLVersions, DllSuffixes, ProjectVersions, Frameworks, ProductVersions, ProductFullNames, BaseKeyPaths, HKCU-BaseKeyPaths, HKLM-BaseKeyPaths
  • Base of the below table:
    • ProductSummaries
  • Installed info (installation status obtained through the registry):
    • InstalledProductVersions, InstalledProductFullNames, InstalledProductSummaries, InstalledPackages

An elaborate wrapper around the Define column is jedi.inc which is used in many projects (both open source and closed source) to distinguish between various Delphi versions, libraries and platforms at compile time (URL: github.com/project-jedi/jedi/blob/master/jedi.inc)

Read the rest of this entry »

Posted in .NET, C#, C# Builder, Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 5 Comments »

Delphi: Alt+Down Arrow is the keyboard shortcut for ellipsis buttons

Posted by jpluimers on 2016/09/01

Thanks Primož Gabrijelčič for reminding me on Stack Overflow that Alt + Down opens the dialogs behind ellipsis buttons in the Delphi IDE.

It’s the CUA and Windows short-cut to open drop-down lists (comboboxes) and for opening drop-down list for a property in the object inspector, but I never realised also would work for these ellipsis buttons.

This was my original stack-overflow question: Is there a keyboard shortcut for the ellipsis buttons of the Project Options in the Delphi IDE?

The Project Options in the Delphi IDE has a few option (like the Search Path) each with an ellipsis button (the one on the right having only three dots ... in the image below) to pop-up a dialog.

What keyboard shortcut activates that button?

Project Options with ellipsis button

–jeroen

Via: Object Inspector Keyboard Shortcuts – RAD Studio

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Keyboards and Keyboard Shortcuts, Software Development | Leave a Comment »

Why sometimes you *want* to to have your DFM files stored as binary

Posted by jpluimers on 2016/08/25

Delphi Component/Tool vendors have to support a truckload of Delphi and C++ Builder versions which can be a pain: they have to work around problems in Delphi and C++ Builder versions that have long been abandoned by Borland/CodeGear/Embarcadero/Idera/…

This means that sometimes the Delphi Component/Tool vendors have to work around stuff in a way normal applications vendors would never do.

Recently I learned that sometimes this can be a painful thing: keeping DFM files in binary state.

I’m not kidding about either the DFM file format nor about supporting old versions:

  • Delphi has supported text based DFM files since like Delphi 2 for most of the features (yes, ‘most’ is the crucial word here) and by default stored DFM files in text format since Delphi 5.
  • For the Component/Tool Vendors, even Delphi 7 makes money though usually less than Delphi 2007 or the C++ Builder side of things.

The ‘most’ applies to this nice ARM compiler bug in Delphi 19.0.13856.4978 (for mere mortals, that’s Update 1 for RAD Studio XE5, Delphi XE5 and C++Builder XE5; I wish vendors would list those numbers/products in a central place):

  • [Android] MsBuild (dccAarm) error when compile FireMonkeyMobile projects with fmx forms
  • Project:  Delphi
  • Build #:  19.0.13856.4978

Source: [WayBack] QualityCentral

That’s why TeeChart still has most DFM files stored as binary files (again the ‘most’ word).

For version control and searching this is a pain, so normal application developers (the ones not using Delphi XE5 Update 1 for Android work) should run convert.exe with the -t (target=text) switch on DFM binary files.

Oh: this is fixed in version 19.0.13856.4978 (yes, that’s XE5 Update 2).

–jeroen

Via:

 

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Kylix, QC, Software Development | Leave a Comment »

Canonical overview on Writing to the Windows Event Log using Delphi – Stack Overflow

Posted by jpluimers on 2016/07/26

A while ago, StackOverflow user Kobus Smit did some brilliant editorial work that – due to current state of StackOverflow – sort of fired backwards: his question got marked as duplicate before he could post his excellent answer. After that answer was posted, the oh-so pride SO-demi gods never took any energy to revisit to see which answers were best.

His simple question:

How can my Delphi app easily write to the Windows Event Log?What is the difference between TEventLogger and ReportEvent? How do I use the ReportEvent function?

Which somehow should be encompassed by this Delphi 5 question (apparently that 15+ year old Delphi version is still considered current by the SO demi-gods).

The answer summarises and extends existing answers spread out over StackOverflow and adds an EventLog git repository wrapping the ReportEvent and RegisterEventSource (which somehow is always a pain: Delphi services for instance often forget that).

Lesson learned when doing editorial work:

  1. prepare both the answer and question in markdown off-line
  2. ensure you mention in the question that the answer is meant as collection of “best of” answers found elsewhere
  3. post the question and answer in rapid succession
  4. cross your fingers for the StackOverflow demi-gods being in a good mood

–jeroen

via: Writing to the Windows Event Log using Delphi – Stack Overflow

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 1 Comment »

Delphi include files and the search strategy are different for the compiler and IDE

Posted by jpluimers on 2016/07/12

Recently I bumped into a thing that I’d long forgotten: the Delphi compiler treats searching for include files (any files used with the {$I} or {$include} directive differently:

  • The compiler first searches the directory where the file that is including resides and then uses the project and IDE search paths.
  • The IDE only uses the project and IDE search paths.

This means that when you press Ctrl-Enter on the filename to be included you might edit a different file than the compiler will include.

So when a product has multiple include files with the same name in different sub-directories, then you must modify them all.

I’m not sure this is a bug or feature, so Embarcadero is free to put this in either their QA system or documentation system.

–jeroen

Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »

A future Delphi won’t download start page content from the Embarcadero site

Posted by jpluimers on 2016/04/05

The “Official statement” of Embarcadero about their recent hacks are in the form of comments on public messages mentioning the hacks, some asking to take discussions offline.

They forgot to comment on Delphi: disable or change your welcome page to not use the Embarcadero site (as that site has been hacked twice this weekend) « The Wiert Corner – irregular stream of stuff, so here is their comment from the G+ thread I posted:

FYI: Future versions will no longer have the banner pulled from the website on the start page.

Source: This weekend, the Embarcadero web site was hacked by AnonCoders. once…

I hope it will be the upcoming Delphi 10.1 Berlin version, but given their speed at responding to security threats, I won’t hold my breath.

–jeroen

PS: what a coincidence that I wrote this yesterday on G+:

I know of a few companies that could benefit from more openness.

Ilya Grigorik originally shared: Edge team announced new (EdgeHTML) open issue tracker: http://bit.ly/1S3uhp5 – yay! The times, they are changing.File away!

Posted in Delphi, Delphi 10 Seattle, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

Delphi: disable or change your welcome page to not use the Embarcadero site (as that site has been hacked twice this weekend)

Posted by jpluimers on 2016/03/14

Initial hack

Initial hack – image via the forums server.

This weekend, the Embarcadero web site was hacked by AnonCoders. Not once (see also [WayBack] G+ link and [WayBackDelphiPraxis link and [WayBackimage) but at least twice (see also [WayBackG+ link and [WayBackimage and [WayBackDelphi Praxis link and [WayBackimage) where the initial hacked simple text “Hacked By AnonCoders ~ Cyber Caliphate” after having been reverted back to the site – hopefully by Embarcadero staff – was replaced with [WayBack] more graphical content later on.

Hack presenting itself in the IDE

Hack presenting itself in the IDE – image via the forums server.

The Welcome Page inside the Delphi IDE uses the Embarcadero web site, so the Delphi IDE Welcome Page was also affected (see also [WayBackthis G+ link).

Because the IDE uses this on-line content, potentially any code could be executed inside the IDE (apart from that page being loaded over http, so any man-in-the-middle could abuse this, but I digress). This imposes a security risk as many developers run the IDE from accounts having more rights than the average user.

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, QC, Software Development | 13 Comments »

A script to check the frequency of Oracle log switches | Oracle DBA tips

Posted by jpluimers on 2016/02/17

A wile ago, I had a this error when trying to get the TIME portion of a DATE column:

ORA-00904: "TIME": invalid identifier

This doesn’t work in Oracle, even though when you search for Oracle convert DATE to TIME you end up at this page listing TIME as a function: 12.7 Date and Time Functions. Alas, that page is for MySQL which is owned by Oracle for a while now.

Back to the query which was like this where date_column was of type DATE.

SELECT 
    id,
    date_column, 
    TIME (date_column)
FROM some_table

That DATE type actually stores date+time, and since it was filled with Delphi TTime values, the date parts would always be “1899-12-30” (yes, I like ANSI DATE and TIMESTAMP formats). Oracle doesn’t get that, so I wanted to get the time portion.

Solutions:

Read the rest of this entry »

Posted in Database Development, Delphi, Delphi 10 Seattle, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, OracleDB, Software Development | Leave a Comment »

Happy birthday Delphi, have some wine

Posted by jpluimers on 2016/02/14

Now that you’re 21, have a glass of wine and watch this great presentation by Warren Postma which he made for last years birthday:

–jeroen

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »