Solved

My VB6 will not allow me to use Microsoft Windows Common Controls-2 6.6 Saying that the Object Library not registered

Posted on 2014-12-11
12
314 Views
Last Modified: 2014-12-19
I know that the mscomct2.ocx was registered correctly, But vb6 Disagrees so I cant use the dtpicker control.
0
Comment
Question by:RichardLudkiewicz
  • 6
  • 6
12 Comments
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
There are several things you must do to register this component:

1. I assume you are running a Windows 7 PC (64Bit) PC since this error has occurred. You will need to copy the MSCOMCT2.OCX file to  "C:\Windows\sysWOW64" not "C:\Windows\system32".

2. Make sure you have mscomct2.ocx included in references within VB6 by clicking on Insert/Componements and browsing to the "SysWOW64" folder to add it to references.

Add OCX component to references
3. You must then register the component by running RegSvr32.exe from the command prompt:  
"regsvr32.exe c:\windows\sysWOW64\mscomct2.ocx"

Make sure that you run this command with administrator privileges. It is best to go into cmd.exe by
clicking on the "Start" button then typing "cmd.exe". You then right mouse-button click (RMBC) on the listed program "cmd.exe". From the context menu that appears choose "Run as administrator"). When the component registers correctly you will get the message:

OCX successfully regsitered
If you are not running a 64 bit machine then you can still register as per above, but place the compenment in the "C:|windows\System32" folder instead.

I hope this solves your problem.
0
 

Author Comment

by:RichardLudkiewicz
Comment Utility
I'm very sorry but it does not, I get all the correct responses on registering the component but when I go into VB6 and try to add the control to my project it comes up with The error message (Object Library not registered).
I have followed all off your instructions to the letter.  I should also add that this used to work ok on my old C drive but it went down and I had to replace with a new one, all programs and games are installed on a separate drive.
0
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
The control may be corrupted.

Try obtaining it again from a trusted source.
If you cannot find it I can upload via "EE Stuff".

The size should be:  647KB

It all worked for me and I attached a DTPicker to a form (showing a date). No problems.
But that, of course, is in a native VB6 application.

I know DTPicker has problems in Exceland other office applications when using VBA.

If you are doing this via VBA then an alternative object (much better) is obtainable from:
http://www.vbaexpress.com/kb/getarticle.php?kb_id=543 (Userform Calendar Control).

With VB6, do you have Service Pack 6 for a 32 bit machine? I cannot understand why it does notwork on your system.

Addendum: After a bit oif investigation, I suddenly realise that SysWOW64 is actually for 32 bit applications/components on a 64 bit machine, while c:\Windows\System32 is for 64 bit applications/components (does not seem to make sense, but there we go)! LOL :-)

I had a look at my c:\Windows\System32 folder and the component is NOT there, so it must be a 32 bit component (in the SysWow64 folder).

Make sure it is ONLY in your SysWOW62 folder.

You could try "unregistering" it using RegSvr32.exe and then re-register it.

Let me know how you go. When it installs, there are 5 components made available to the toolbox:
DTPicker, FlatScrollBar,UpDonw, MonthView and Animation.
0
 

Author Comment

by:RichardLudkiewicz
Comment Utility
I have done all off the things you have recommended including downloading a new OCX and unregistering and then re-registering the OCX and still VB6 is Telling me that the (Object Library not registered)  even though its in the list. This is very important for me as I have at least 10 apps that I cant update anymore. The mscomct2.ocx I have is 633 KB there are no extra mscomct2.ocx on the C drive but there is an mscomct2.inf file in the same place.
0
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
I have four files in my SYSWOW64 Folder:

Files related to MSCOMCT2.OCX:
You could try renaming your "inf" file to "mscomct2.inf.old" then reboot your machine.
Another possibility is that VB6 is at fault (unlikely) so you could try uninstalling VB6 then re-installing, but before doing that, try getting the files I have available through the following link, installing then in your SYSWOW64 folder, then registering the OCX file as described earlier.

https://filedb.experts-exchange.com/incoming/ee-stuff/8397-MSCOMCT2_Files.zip

By the way, you should reboot after running REGSVR32.exe registration.

Let me know how you go.
0
 

Author Comment

by:RichardLudkiewicz
Comment Utility
I have done all that you have told me to do, the vb6 installation took out the oca so I copied it back and re-registered and all was fine rebooted the computer and started vb6 opened my app and tried to add the Microsoft Common Controls-2 6.0 And vb6 came back again with (Object library not registered).
Something you said at the beginning is bothering me,

Your Quote
2. Make sure you have mscomct2.ocx included in references within VB6 by clicking on Insert/Componements and browsing to the "SysWOW64" folder to add it to references.

I don't understand what you mean as the control appears in the list of components.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:RichardLudkiewicz
Comment Utility
Why Have I not had a solution yet it is very important that a solution is found for my problem.
0
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
Well if it shows in your list of components it has been added to your VB6 references,but that does not guarantee it has been registered.

Can you run the register process again (using regsvr32.exe under "administraion" provileges as detailed earlier) and get a screen capture of its acknowledgment that it has registered?

Once we confirm that it has indeed been registered, then we have reached a dead end.

If you like, I can make a video on how to install this praticulr component and maybe that may highlight something we have "miscommunicated" somehow thusfar.

Sorry about the delay.....I have just lost a family member and my thoughts took a while to get back to Experts Exchange.

Cheers
Chris
0
 
LVL 13

Accepted Solution

by:
Chris Raisin earned 500 total points
Comment Utility
I have added a short video tutorial on the registration process to YouTube.

Have a look at it here to see if this clarifies things and helps you out.

https://www.youtube.com/watch?v=xpOKXukqqwE
0
 

Author Comment

by:RichardLudkiewicz
Comment Utility
Thank You Thank You It has now worked I watched the video and just added the control from the installable tab and low and behold I have a date time picker thank you very much indeed.

Richard Ludkiewicz
0
 

Author Closing Comment

by:RichardLudkiewicz
Comment Utility
We got there in the end, thank you very much
0
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
My pleasure, Richard! Sorry the video was a bit hesitatnt, but it was prepared very quickly without any rehearsal.

I must admit I had not noticed that I was logged on as an administrator (as evidenced in the "cmd" command window) and so perhaps you DO need to be an administrator to register the OCX files via "RegSvr32.exe".

Usually PC's with only one user (like mine) have that one user with administrator "powers". It is only PC's that have multiple users which have one as an administrator and the others as "normal" users.

I am fairly certain that if you install the OCX, "unregister" it and then close your project and start it up again you will get an error when running the program. This is perhaps what happened to you.

Perhaps you created your project on a machine that has crashed and been rebuilt, or you uninstalled VB6 then re-instal;led it (which would clear all the registered OCX's in the registry) or you transferred your project to a new PC where the OCX was laready in use in your project but had not been freshly regsitered.  In any of these scenarios you would receive the error message which weas hainting you.

I guess also (because you stated that you had registered it using the "cmd" run of "regsvr32.exe") that either you were not an administrator at the time, or the OCX was placed in the wrong folder and registered there (in which case it is probably living in TWO folders so just remove it from the 64 bit folder by deleting the file).

Anyway, all's well that ends well, and as you can guess "a picture is worth a thousand words"....That is why I like to create videos whenever I can....It is also better to put them on YouTube because it helps more people (and saves EE disk space!)  :-)

Have a Merry Christmas and safe and exciting New Year........Regards from Australia.

Chris
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I'd like to talk about something that is near and dear to my heart: build systems. Without them, building software is all about compiling locally, with software versions everywhere. It can be a mess. Today we are going to discuss building a small di…
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now