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 XE6’ Category

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 »

Windows Vista/7/8/… hangs for Windows Common dialogs when your COM initialisation is wrong

Posted by jpluimers on 2016/02/03

A while ago I bumped into this: As of Windows 7 (and probably Vista), the standard Windows Common Item (Open and Save) Dialogs expect the main thread to be initialised with STA because it is easier to support apartment threading in single-threaded apartments because COM provides synchronization on a per-call basis and the Windows GUI APIs are not guaranteed to be thread safe.

Windows XP and Server 2003 didn’t enforce this for the classic Windows Open and Save Dialogs, so it only appeared when the software below got run on Windows 7 in a way too late time frame (but the market share of XP is still high).

The reason is that when using Delphi, the TOpenDialog and TSaveDialog will use the classic Open and Save Dialogs on Windows < Vista and fall-forward to the new Common Item Dialogs handled by TFileOpenDialog and TFileSaveDialog (both will not fall backward).

When you have your COM initialisation done wrong, your application appears to hang. Amidst the plethora of threads started by the COM subsystem, these two dead-lock:

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, 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 »

The forks of SynEdit (in case I need it in Unicode)

Posted by jpluimers on 2016/01/19

Just in case I need SynEdit in Unicode:

Old SVN versions are at

Newer Github repositories are at

The finaly one has a Demos folder and links to the original ANSI version. It seems the only version for which SynGen works in Unicode Delphi versions.

–jeroen

via Missed link? Anyone know what happens there? :) Once again: 1.SynEdit?  ….

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

Some links on DUnit test cases and test suites, XML and XSD

Posted by jpluimers on 2015/12/17

DUnit registration can mix TestSuites and TestCases.

Some links:

–jeroen

 

 

 

 

Posted in Agile, Delphi, Delphi 10 Seattle, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, 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, Unit Testing | Leave a Comment »

The curse of nested DataSet fields in ClientDataSets: naming conventions

Posted by jpluimers on 2015/12/03

Nested DataSet fields assume identical naming of fields and parameters as Richard Stevens did comment in   So I’m in total n00b mode here. I’m trying to set up a master/detail….

Of course the documentation for that is easy to find. Not.

Even this article by Cary Jensen doesn’t reveal the issue: Nesting DataSets in ClientDataSets.

So thanks Richard for clearing that up!

–jeroen

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

Undocumented Delphi record alignment directive – Chee Wee’s blog: IT solutions for Singapore and companies worldwide

Posted by jpluimers on 2015/12/02

Reading a thread with ramblings on failing to understand that packed records overrides the $ALING directive, I found out that there is also an Undocumented Delphi record alignment directive – Chee Wee’s blog: IT solutions for Singapore and companies worldwide.

David Heffernan mentioned some nice permutations in the first thread.Chee Wee Chua “documents” the second. Both provide great reference material.

Note that both directive require a const expressions evaluating to a power of two. If you don’t, you get the same error: E2573 Illegal value for the ALIGN directive (valid for one of 1, 2, 4, 8 or 16) (Delphi) – RAD Studio

–jeroen

via:

Posted in Delphi, Delphi 10 Seattle, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »

Interesting use of an IDE plugin: Copy a string from a “Watch” entry to the…

Posted by jpluimers on 2015/12/01

On the todo list:

Interesting use of an IDE plugin: Copy a string from a “Watch” entry to the clipboard without quotes. – Thomas Mueller (dummzeuch) – Google+

Source: delphi – Can I change the display format for strings in the watch list? – Stack Overflow:

Every now and then I use the watch window to display strings which contain sql statements.Now I select Copy Value from the context menu and get

'SELECT NAME FROM SAMPLE_TABLE WHERE FIRST_NAME = ''George'''#$D#$A

but want

SELECT NAME FROM SAMPLE_TABLE WHERE FIRST_NAME = 'George'

The answer by MartynA has an OTA plugin that could be integrated with something like GExperts.

–jeroen

via: Interesting use of an IDE plugin: Copy a string from a “Watch” entry to the clipboard…

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

Ensure you know the state of an instance.

Posted by jpluimers on 2015/11/24

A while ago, I came across a class having (among other members) two methods named like this:

  • Start
  • Stop

Within one of the other members of the class, I had to (temporarily) Stop processing, then Start it again.

But I couldn’t, as neither Start, nor Stop would make a record of the state it left the instance in.

Always ensure you know the state of an instance.

So I added the state, and tests to ensure a Stop/Start change was indeed not breaking things.

–jeroen

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Delphi, Delphi 10 Seattle, 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 | 1 Comment »

Do not expose properties with writeable fields without a chance to react on the writes.

Posted by jpluimers on 2015/11/04

From a chat with a co-worker a while ago:

I’m not against properties. Just something against properties properties that are objects with writeable fields.

So even if you expose such a property as read-only, it can still get its writeable fields overwritten.

That is a pain when those are part of the state of the underlying object.

In other words: encapsulate your state changes.

Here we solved it by making

  • the type of the property immutable
  • the property writeable
  • react on state changes during the write

Proper encapsulation.

In this case it was a project mixing C# and Delphi, but you can easily apply the above to any language featuring classes and properties.

Another solution would have been to extend the type of the property so it can expose an event that fires during change. Much more convoluted.

–jeroen

Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Delphi, Delphi 10 Seattle, 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 »

Please review your DFM files before you commit to version control

Posted by jpluimers on 2015/10/22

Recently I bumped into it again with one of the more current Delphi XE* versions and Delphi 2007: the IDE changing the DFM files without reason.

This time it was in a multi-team environment with many branches and DFM merge hell.

A few examples of properties and components getting changes:

Warren P suggests to review your DFM changes before committing to version control and I completely agree: it is the only way to ensure they are indeed unwanted changes.

There are some stop-gab things you could try, but these only partially help

–jeroen

via:

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 | 7 Comments »