3

I am trying to open VB6 project and getting "Object library not registered" error.

Machine is 64 bit. I tried below but it threw error saying "'regtlib' is not recognized as an internal or external command, operable program or batch file."

cd C:\Windows\SysWOW64
regtlib msdatsrc.tlb

'C:\Windows\Microsoft.NET\Framework64\v4.0.30319' folder has 'regtlibv12' file. I tried 'regtlibv12 msdatsrc.tlb' in that folder but it did not help.

I read on one of the forum that un-installation of internet explorer 10 is solution, I tried that but did not help.

I would highly appreciate your suggestion.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
magg
  • 119
  • 1
  • 3
  • 11

3 Answers3

1

The regtlb.exe is used to register type libraries, in older Windows versions it can usually be found under

c:\windows\system32\RegTlb.exe

The .Net Frameworks bring a new version:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regtlibv12.exe

You should be able to register any *.tlb files with

regtlibv12.exe file.tlb

And unregister with

regtlibv12.exe -u file.tlb

You'll have to make sure that both files are accessible, when switching in on of the .Net folders use the full path to your type library.

And of course you actually need to have the file present, otherwise registration won't work.

Kevin Sandow
  • 4,003
  • 1
  • 20
  • 33
  • I tried C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe msdatsrc.tlb but did not solve the problem. regtlibv12.exe is not present under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727. Do I need to care about v2.0.50727? I also have v3.0 and v3.5 under Frameworks folder. – magg Jun 19 '14 at 22:01
  • So msdatsrc.tlb is present? Unfortunately you don't get any feedback from the process. Since the type library you registered might be 32-bit is your target platform "Any CPU", an error stating `Cannot find wrapper assembly for type library "MSDATASRC"` might indicate that your trying to build for 64-bit,but your assembly won't allow that. – Kevin Sandow Jun 20 '14 at 05:57
  • No, msdatsrc.tlb is not present in both folders. While opening VB6 project I am getting error "Object library not registered" error. And I read that I can perform "cd C:\Windows\SysWOW64 regtlib msdatsrc.tlb". I am not sure whether this is the way to solve the issue.. But if you know any other solution to fix the issue of " Object library not registered" then it would be great. – magg Jun 20 '14 at 13:11
1

On a rebuilt Windows 7 64 bit machine I was getting this error on a VB6 application that we still maintain.

I tried the reregistering of MSCOMCTL.OCX multiple times in SysWoW64, tried changing the project reference from 2.0 to 2.1 and all the other solutions offered. In the end I created a new project using MSCOMCTL.OCX (after reregistering), saved the project file and opened it in notepad. I noticed that whereas in my VBP the common controls library was referenced like this:

Reference=*\G{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0#..\..\Windows\SysWOW64\MSCOMCTL.OCX#Microsoft Windows Common Controls 6.0 (SP6)

In the working project it was referenced like this:

Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0; mscomctl.ocx

Changing to using the object reference then fixed the issue. Note that I have no idea why this was a project reference rather than a component reference and this project had been successfully compiling prior to the machine rebuild.

1

I recently got a new Windows 7 64 and had to install VB6. I also got the "Object library not registered" error when I tried to open my VB6 project.

I solved this with the following: cd C:\Windows\SysWOW64\ regtlib msdatsrc.tlb

JimMoore
  • 31
  • 2