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,676 other followers

Archive for February 3rd, 2016

gabriel peery on Twitter: “@HenryHoffman I guess we could say that this is #GITarHeroMasterMode https://t.co/XE7NdpI3NM”

Posted by jpluimers on 2016/02/03

Posted in Uncategorized | 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 »

Get the full exe path name of running processes.

Posted by jpluimers on 2016/02/03

Every once in a while, I need to see which EXE paths.

In this particular case, I wanted to see which Spring.Tests unit tests instances of Sprnig4D werere running.

This case I needed to see which DevEnv were running (because somehow I got my .csproj bindings wrong).

Since tasklist nor pslist would cut it, I wrote two small batch files:

:

PowerShell to the rescue here: Both use the PowerShell Get-Process cmdlet.

First I used Get-Member to see what Get-Process could return:

PowerShell Get-Process ^| Get-Member

Then I filtered the Path from Get-Process to figure out which Spring.Tests processes were running:

PowerShell Get-Process Spring.Tests ^| Format-List Path

resulting in:

Path : C:\Users\Developer\Versioned\Spring4D\Tests\Bin\DelphiXE\Spring.Tests.exe

The second batch file escapes the pipe (|) by using a carret (^), so it is passed from the command-line to PowerShell.

–jeroen

Posted in CommandLine, Development, PowerShell, Software Development | 2 Comments »

It Was Never Going to Work, So Let’s Have Some Tea on Vimeo

Posted by jpluimers on 2016/02/03

Posted in Uncategorized | Leave a Comment »

 
%d bloggers like this: