Visual Studio 6 Windows Common Controls 6.0 (sp6) Windows 7, 64 bit
Asked Answered
H

15

28

I was asked to help work on a legacy vb6 application for someone, so I decided to toss Visual Studio 6 on my Windows 7 x64 laptop following this guide.

It installed fine, and from I can see everything is working except for Microsoft Windows Common Controls 6.0 (sp6). Microsoft Windows Common Controls-2 6.0 (sp6), Microsoft Windows Common Controls 5.0 (sp2), etc. all work just fine. However, when I try to add the Microsoft Windows Common Controls 6.0 (sp6) component I get the error:

'' could not be loaded

I could not add an image, so I have uploaded a screen shot to here for anyone wanting to see it exactly:

https://static.mcmap.net/file/mcmap/ZG-Ab5ovKRkQZV0nc79QWRft/7aym4xB.png

I have tried registering/un-registering/re-registering MXCOMCTL.OCX, MSCOMCT2.OCX, msdatsrc.tlb all with no success. I have also uninstalled a known security update that may have caused issues with Windows Common Controls. I have removed IE11, even though reports state IE11 will not cause issues with MSCOMCTL.OCX the way IE10 did.

I run VB6.EXE in Windows XP SP3 Compatibility mode. With Disable visual themes, Disable desktop composition, and Disable display scaling on high DPI settings. As well as run it as administrator.

I have also attempted to open a previous project that utilizes this control, and it fails during load with the same "blank" error as in the screen shot with the following in the generated error log:

Line 35: Class MSComctlLib.ListView of control lvData was not a loaded control class. Line 223: Class MSComctlLib.StatusBar of control Stat was not a loaded control class.

So that tells me it isn't a version issue within the .vbp like some suggest (as it happens with new, blank projects as well).

I am at wits end. Apparently people have gotten both VB6 and Windows 7 x64 to work properly (with Windows Common Controls) but NOTHING I have tried alleviates my problem. I am hoping someone here may have run into this, or have some ideas as to what is going on.

Horseman answered 22/12, 2013 at 8:23 Comment(5)
one idea - it will probably be quicker and less painful to virtualise windows xp and start again...Counterproposal
I figured out the fix for this, I just can't post an answer to my own question for 8 hours because I am on a new account (forgot the login info for my old one). I really didn't want to run xp in a vm just to use 1 application... which is why I spent so much time trying to find a fix for this. Thanks for the suggestion though.Horseman
I second the 'run xp in a vm', I can almost guarantee you will be glad you did in the long run.Regicide
@E.J.Brennan I run vs6 sp6 in Win7 x64.. no problems.... kb 2640696 must be applied to correct the ADO guid issue, though.Moreau
Yes, but just because its possible, doesn't mean it's a good idea. What happens when the next thing gets installed/updated and the whole thing breaks again? Still think its a good idea to setup a stable vm if you need to work with a 15 year old developer tool that isn't supported by MS anymore.Regicide
H
52

While waiting for a reply for ideas here, I had decided to try something. I ran regedit as administrator, navigated to the HKEY_CLASSES_ROOT\TypeLib Key and then did a search for "MSCOMCTL.OCX"... I deleted EVERY key that referenced this .ocx file.

After searching the entire registry, deleting what I found, I ran command prompt as administrator. I then navigated to C:\Windows\SysWOW64 and typed the following commands:

regsvr32 MSCOMCTL.OCX
regtlib msdatsrc.tlb

Upon registering these two files again, everything is WORKING! I scoured the web for HOURS looking for this solution to no avail. It just so happens I fixed it myself after posting a question here :( Even though Visual Studio 6 is outdated, hopefully this may still help others!

Horseman answered 23/12, 2013 at 4:53 Comment(5)
Thanks, you have probably saved me a ton of work. Like Loloy D below, I just ran the commands without going through the registry. And instead of regtlib (which was not found on my system) I have used regtlibv12. The later is included in (some) .NET framework versions.Neiman
Been googling this nonsense for the past hour, ran across this post and solved my problem. I had to remove it from the registry in order for this to work. I was having problems with mscomctl.ocx and comctl32.ocx. unregistering and reregistering didn't help, needed to purge from the registry. Thanks Jay!Chi
FYI, rather than searching through the registry and removing references to MSCOMCTL.OCX I ran regsvr32 /u mscomctl.ocx before running the two commands in Jay's answer and it worked ok for me. Also, I used regtlibv12 from the .net framework directory ( C:\Windows\Microsoft.NET\Framework\v4.0.30319 ) - so in some cases it seems unregistering works well enough (I'm on Win 7 32 bit however).Illconsidered
Same here. With 2008R2, I just unregistered the ocx, re-registered it, and registered the tlib with regtlibv12 from the Framework directory. All from an elevated command prompt. (Click Start, type "command", then right-click "Command Prompt" from the list and select "Run as administrator")Donielle
I did like you'd done (removed keys related to it) and when I ran the new projects, there are so many ocx got failure, such as, comdlg32.ocx, etc. Well, I almost got frustrated. Then I downloaded file "microsoft windows common controls (SP6) and installed them and everything went great. I downloaded the file here: download.microsoft.com/download/3/a/5/…Ouch
H
12

Implementing the two directives already worked for me from within "C:\Windows\SysWOW64"

regsvr32 MSCOMCTL.OCX
regtlib msdatsrc.tlb

It's worth noting that the DOS box should be in Administrator mode. Prior to this, I kept having errors in the vein "Class MSComctlLib.TreeView of control tvTreeView was not a loaded control class" and "Class MSComctlLib.ListView of control lvListView was not a loaded control class".

I am also using Visual Studio 6 on 64 bit Windows 7, with SP6 updates. I was driven here due to the same problem. In my case, I did not need to go through the registry.

Hah answered 28/1, 2014 at 4:4 Comment(1)
No problem, glad another person found this useful.Horseman
G
3

I have searched this issue for hours and clicked in hundreds of websites, none of them worked.

My final solution:

  1. run:cmd
  2. cd c:\Windows\SysWOW64(locate to the location)
  3. regsvr32 MSCOMCTL.OCX

this solves the first one. For the second one:

  1. run: cmd
  2. cd c:\Windows\Microsoft.NET\Framework\v4.0.30319
  3. regtlibv12 msdatsrc.tlb

done.

this may not work for everybody (considering the system version reason, etc)

Ganges answered 1/12, 2016 at 21:15 Comment(0)
S
2

I was having the same difficulty loading my VB 6 project. Here is a sample error message: "Class MSComctlLib.ProgressBar of control prgExecution was not a loaded control class."

This problem was solved by some Microsoft Magic as follows: I opened the Project Components window in my broken project. I clicked on Browse and found the file MsComctl.ocx. I clicked on OK. VB 6 then got stuck (the application non responsive). After some time, I ended the VB 6 application using the task manager.

Then, magically, when I opened up my VB 6 project to show my programming friend what a POS this project was, all the controls were back, linked as expected. Somehow, something was registered or fixed.

Sterigma answered 28/5, 2014 at 20:52 Comment(0)
F
1

SIMPLE SOLUTION

  1. Create a new blank project and save it
  2. using NOTEPAD open the .VBP of the new project and copy the MSCOMCTL line
  3. using NOTEPAD open the .VBP file of your project
  4. replace the MSCOMCTL line and save it

DONE

good luck

Farrington answered 28/1, 2016 at 12:33 Comment(1)
This is the best solution. I tried this solution and worked like charm. Thanks!!Everrs
R
1

Just today I had the (questionable) pleasure to get VB6 code running on Windows / 64 Bit. I did come across this thread, but none of the proposed solutions worked for me. Neither worked adding references using the "Project -> References..." menu.

To get it running, I had to manually modify the VB6 project file (*.vbp). For all the libraries I had load issue with I had to use the following notation to define as reference: Object={Registry Key}#Version#0; LIBRARY.OCX Example: Object={FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0; DBLIST32.OCX

I had not to register any of the libraries (using regsvr32), these were all already correctly registered. I guess why my solution works is that if the "object={[...]" notation is used (instead of the "Reference=*\G{[...]" notation) VB Studio is using the Registry Key only and gets rooted to C:\Windows\SysWOW64 while as the other way ends up looking in C:\Windows\System32

By the way, IE11 is installed. Whether or not this matters, only Bill G might know. My guess is that my solution works regardless which IE is installed. You just might have to unregister and register the missing libraries as mentioned in this thread.

Hope that helps anyone who faces similar issues.

Recruit answered 19/9, 2016 at 13:56 Comment(0)
O
1

Open Registry Editor using run command regedit.

Locate HKEY_CLASSES_ROOT\TypeLib Key and then did a search for "MSCOMCTL.OCX" and deleted EVERY key that referenced this .ocx file.

Open command prompt (cmd) in Administrator mode. The type the following code,

In 32 bit machine,

cd c:\Windows\System32
regsvr32 MSCOMCTL.OCX
regtlib msdatsrc.tlb
regsvr32 MSCOMCT2.OCX

In 64 bit machine,

cd c:\Windows\SysWOW64
regsvr32 MSCOMCTL.OCX
regtlib msdatsrc.tlb
regsvr32 MSCOMCT2.OCX
Oswald answered 9/8, 2018 at 13:17 Comment(0)
T
0

I had the problem whereby VB6 IDE would not load the common controls (Sp6)with VB6 install on W7 64bit, specifically comctrl and msmask. I tried all the solutions proposed using regsrv32 (elevated), edited the registry, changing the version number in the vbp etc as proposed by MS and others. All failed. These solutions worked on my other 2 PCS but not this one. Eventually I removed IE11 and all worked properly afterwards. IE10 had never bene installed on thsi PC - we went straight from IE8 to IE11 and have been forced to backtrack to using IE8.

I have to say the simple solution above does not address the problem which is that the VB6 IDE will not load the common controls (using the Components menu selection under Project) - you get an error saying Object not loaded. So this will happen (and I proved this to myself) on any project, new or old that try to use theose common controls that will not load.

So my suggestion to anyone who has this problem is to try the manual register solution using regsrv32 route, then the edit the vbp to change the version, and if these fail uninstall IE11 (and defintely IE10). But this may still not be a 100% solution because if your existing project files ".vbp" contain references to the wrong common controls you need to correct that manually - this is where loading a new project, loading the Components you need inside the IDE, then edit the newly create vbp using notepad and copy the version numbers for the common controls to your existing vbp files.

Teeters answered 8/2, 2016 at 13:48 Comment(0)
T
0

=> just what jay said just delete those registry entries which are pointing to other paths other than on c:\windows\system32.Those are the culprits of the error.I got those errors on my vb6 IDE and after deleting those anomalous registry entries the problem was fixed. works like a charm.

Taking answered 2/8, 2016 at 1:11 Comment(0)
S
0

I believe it may be related to a issue in which Microsoft released a update to the MScomCtlLib which was incorrectly patched by microsoft, causing registry errors.

I believe if you follow the advice laid out in:

https://support.microsoft.com/fr-fr/kb/2597986

Salyers answered 29/9, 2016 at 14:24 Comment(1)
Ideally the steps to resolve would be in the Answer itself, with a link to the source for backup. Also, this link is to a French language page, is that likely to be the most useful format for the readership of this site?Scoles
D
0

I get same issue but I was getting error below error when run regsvr32 MSCOMCTL.OCX

The module "MSCOMCTL.OCX" was loaded but the call to DllRegisterServer failed with error code 0x8002801c.

When I run CMD.EXE as Administrator, then it solved my issue.

Some Times VB6.EXE also need o run as administrator to access some registry issue.

Good Luck.

Durrell answered 19/12, 2016 at 10:6 Comment(0)
H
0

I had the same problem running windows 7-64 with VB6. I tried the unregister and re-register solutions above but it did not solve the problem. Then I noticed that in my VB6 Components I had references to both the Microsoft Windows Common Controls -2 6.0(SP6) and Microsoft Windows Common Controls -3 6.0(SP5). I removed the SP5 reference and all now works OK. It seems that -2 6.0 SP6 supersedes -3 6.0 (SP5) and when both are present there are two references to the same control. Hope this helps. Steve

Hoptoad answered 23/8, 2018 at 12:9 Comment(0)
D
0

My solution was replacing the MSCOMCTL.OCX on windows 10 box with one from a Windows 7 box that also had MS Access installed. For some reason, there are different MSCOMCTL.OCX 2.0 controls with the same name.

I know this sounds crazy, and might not help anyone else, but we have saved this MSCOMCTL.OCX with a readme file and it has fixed our new install errors every time.

we unregister the current MSCOMCTL.OCX that came with Windows 10 box, delete it, and register the old one we have saved.

Dacron answered 27/9, 2018 at 22:58 Comment(0)
R
0

Open the VB6 YourProject.vbp file, go to component and look for "Microsoft Windows Common Controls 6.0 (SP6)"and note the directory where the MSCOMCTL.OCX file is located.
In my case, the location is C:\Program Files (x86)\Microsoft Visual Studio\VB98.

Copy a different version of MSCOMCTL.OCX (my version file size is 1,070,232 bytes, date modified 2015/dec/09) to the folder "C:\Program Files (x86)\Microsoft Visual Studio\VB98",
then register it with command regsvr32 MSCOMCTL.OCX.

Once registered, try loading the vbp file "YourProject.vbp". If it loads successfully, you can skip the remaining steps.

If the problem still remains, open the vbp "YourProject.vbp" file with notepad, then look for a line similar to the examples below. In my case I change from 2.1 to 2.2., and save it. You may change the 2.0 to 2.1, or 2.1 to 2.0... to try

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

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

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

After saving the file, Attempt to load the vbp file again.

If neither registering the DLL nor modifying the vbp file resolved the issue, try using another version of MSCOMCTL.OCX and repeat the process until you find a version that works correctly.

Rah answered 20/6, 2023 at 11:49 Comment(0)
T
0

My solution was reinstall VB6 and DELETE MSCOMCTL.OCX from c:\Windows\syswow64 so this lib will work from vb6 install path. It worked.

Toffic answered 8/11, 2023 at 1:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.