Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class MSComctlLib.[ListView|TextBox|ect] of control controlName was not a loaded control class

This error is from a machine compiling a vb6 dll which suddenly stopped working and used to work fine.

I've seen this on the net a lot the solutions that i could find and were relevant to me. Including these ones which seemed promising from http://www.xtremevbtalk.com/archive/index.php/t-140158.html and one from http://www.excelfox.com/forum/f2/missing-mscomctllib-15/

Both of these suggested re-registering the MSCOMCTL.OCX

But after following both of these I still had the problem. After hours of searching and trying different things I realised that there were some updates which had been installed and waiting a reboot of the machine because of corporate policy.

The Answer

I rebooted the machine and waited for the updates to finish installing. After that the dll compiled without a problem.

like image 313
Matt Vukomanovic Avatar asked Dec 05 '22 14:12

Matt Vukomanovic


2 Answers

I was having the same issue after installing some Windows updates (including upgrading to IE10), and VS2012 Update 3, but the updates were fully installed, and MSCOMCTL.OCX was already COM-registered. On an other StackOverflow post I found about this issue, this finally resolved it for me:

Run a command prompt as Admin

Navigate to C:\Windows\SysWOW64 on 64-bit systems, or C:\Windows\system32 on 32-bit systems

Execute 'regtlib msdatsrc.tlb' (without quotes)

Credit goes to 'Auto': VB6 IDE cannot load MSCOMCTL.OCX after update KB 2687323

I'm posting here since you're the first result when searching for this error.

like image 57
anonWrkrB Avatar answered Dec 11 '22 08:12

anonWrkrB


This answer should work if the computer was compiling the dll/ocx at some point but isn't any more, but MAY also work if your computer never has compiled it either.

So the simple answer to the question is to check if your machine has pending updates waiting for a reboot.

If so make sure that you reboot your machine.

If The problem is still occuring after a reboot then try re-registering MSCOMCTL.OCX which should be in your windows subdirectories; either c:\windows\system32 or c:\windows\SysWOW64. Note you use regsvr32 to register the ocx.

like image 30
Matt Vukomanovic Avatar answered Dec 11 '22 08:12

Matt Vukomanovic