Empty Drop Down Lists in MSCOMCTL Properties UI

Visual FoxProAs I’ve touched on before, I look after a CRM/ERP system that I wrote in Visual FoxPro.

As robust as the system is, I occasionally have to dip in and add a new feature or tweak one of the existing ones.

Last week I opened up the project to add a few new interfaces and came across a rather frustrating bug – not with Visual FoxPro but with some of the ActiveX controls that I use.

I make extensive use of “Microsoft’s Common Controls” and have done for over twelve years.

I use all sorts of controls in my Visual FoxPro applications but Microsoft’s Listviews and Treeviews are so ingrained in my CRM package that most people wouldn’t recognise it as FoxPro at all.

I have a few handy subclasses of Listviews set up for use, so imagine my surprise when I drop one onto my latest form and try to add a couple of  new columns, only to be told that I had entered an “Invalid Property Value”.

ListView general properties Before and AfterAll I had done was add a Column Header, name it, size it and click Apply.

It was then that I noticed that the “Alignment” drop down list was empty, no default value and no contents.

Now I won’t say that this was a show-stopper.  I could still add columns programmatically and the overall application didn’t seem to be affected in any way.  Listviews and Treeviews still operated as expected in the live application – I just couldn’t use the Properties dialogue to change anything that required an entry from one of the drop down lists.

My first attempt at googling the problem turned up nothing of use, so I posted for advice from places like the Universal Thread and DaniWeb.

After the weekend there was no response on either forum so I tried a change of tack, googling instead for Microsoft updates that may have affected MSCOMCTL.OCX (one of the physical files that provide Microsoft’s Common Controls Library).

ListView Column Headers Before and AfterAs it happens, I haven’t edited any of my Visual FoxPro applications for a good couple of months.  Most functionality is held in SQL Server 2008 and new features tend to be held back for inclusion in new web based applications.

There was a security update, released August 14th 2012, MS12-060.  Apparently, a vulnerability in Windows Common Controls could allow remote code execution.

Good to know, especially when the first site that informs me of this also verifies that the security update can mess with the library and stop it working in Visual Basic 6.0.

So, I figure my problem is likely caused by the same update and carry on reading various posts and blog entries with fixes.

Microsoft have released fixes themselves:

But, to be fair, I used the manual fix without any problems.  A couple of sources suggested this and it worked a treat for me.

  1. Unregister your mscomctl.ocx from wherever yours is kept (System32 or SysWOW64).
  2. Rename your current version to something temporary.
  3. Copy an older version to the same folder.
  4. Register it.
  5. Unregister it.
  6. Rename the copy of the older version (or delete it).
  7. Rename the original to mscomctl.ocx.
  8. Register it one final time.

I’ve also created a batch file to do this on my client PCs, in case they do start to have issues with the various Lists and Trees used in the platform.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s