33

I try to add Microsoft Rich Textbox Control 6.0 (SP6) control via Project -> Components... in VB6 IDE. The control is present in the list of controls. When I tick it and click OK/Apply, I get Object library not registered error:

VB6 IDE Object library not registered error

Environment is Windows 7 SP1 x64 with latest updates, VB6 SP6 + KB957924. richtx32.Ocx is present in C:\Windows\SysWOW64\.

I tried re-registering .ocx by running this in elevated command prompt:

cd c:\windows\SysWOW64
regsvr32 /u richtx32.Ocx
regsvr32 richtx32.Ocx

Registration completes successfully, but doesn't resolve the problem.

When I look at what's going on under the hood with API Monitor, the most recent suspicious call is LoadRegTypeLib ({7c0ffab0-cd84-11d0-949a-00a0c91110ed}, 0x0001, 0x0000, LOCALE_NEUTRAL, 0x0018e82c) that returns TYPE_E_LIBNOTREGISTERED.

Ilya Kurnosov
  • 3,180
  • 3
  • 23
  • 37
  • 1
    There's a related question where I came from and that fits my problem better. It seems to have the same solution. http://stackoverflow.com/q/15614730/828499 – Semmel May 02 '13 at 22:37
  • This solution also applies to [Object Library Not Registered When Adding Windows Common Controls 6.0][1] [1]: http://stackoverflow.com/questions/15614730/object-library-not-registered-when-adding-windows-common-controls-6-0 – Matias Sebastiao May 10 '13 at 00:11

1 Answers1

58

The problem has been resolved by running the following in elevated command prompt:

cd C:\Windows\SysWOW64\
regtlib msdatsrc.tlb

This also helped with other older .ocx files, like Graph32.ocx and Threed32.ocx

Community
  • 1
  • 1
Ilya Kurnosov
  • 3,180
  • 3
  • 23
  • 37
  • 1
    Thanks! That actually fixed my problem with MSCOMCTL.OCX. Any deeper insight on what it does or how it works? – Semmel May 02 '13 at 22:30
  • 4
    @Semmel It boils down to very basic COM knowledge. The root cause of the problem was that particular interface wasn't registered in a system. So obvious resolution was to register type library with description of the missing interface. That's what `regtlib` does. Try out this link if you are still confused: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366757.aspx – Ilya Kurnosov May 03 '13 at 08:09
  • 1
    I encountered this same problem on a 32-bit Windows 7 machine. The fix is the same, it's just that `regtlib` resides in **`C:\Winodws\System32`**. – raven Jan 30 '14 at 15:51
  • 17
    If there is no `regtlib.exe` in `C:\Windows\System32`, `C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe` also works. – Bulletmagnet Apr 17 '14 at 10:04
  • On my windows 7 64 bit mahcine I didn't have regtlib in syswow64, but running the one in c:\windows\system32 fixed the problem. – cedd Jul 13 '15 at 10:27
  • Had the same problem loading an old VB6 project your answer worked thanks. – fuzzy dunlop Sep 29 '15 at 18:43
  • Thx so much for this fix! I've been banging my head for a few days now from having the same issues and trying to figure out what the heck was going on. – ckkkitty Jun 21 '16 at 21:26
  • I had a similar issue with Threed20.ocx and Sheridan's calendar widget controls (SSCALA32.ocx). regtlib fixed the issue for me also. – mikecamimo Aug 02 '16 at 03:03
  • Save the day for me. regtlibv12.exe msdatsrc.tlb fixed the issue for me – Preetham Reddy Oct 02 '18 at 22:41