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

I know that the mscomct2.ocx was registered correctly, But vb6 Disagrees so I cant use the dtpicker control.
RichardLudkiewiczAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris Raisin(Retired Analyst/Programmer)Commented:
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
RichardLudkiewiczAuthor Commented:
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
Chris Raisin(Retired Analyst/Programmer)Commented:
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
Simple Misconfiguration =Network Vulnerability

In this technical webinar, AlgoSec will present several examples of common misconfigurations; including a basic device change, business application connectivity changes, and data center migrations. Learn best practices to protect your business from attack.

RichardLudkiewiczAuthor Commented:
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
Chris Raisin(Retired Analyst/Programmer)Commented:
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
RichardLudkiewiczAuthor Commented:
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
RichardLudkiewiczAuthor Commented:
Why Have I not had a solution yet it is very important that a solution is found for my problem.
0
Chris Raisin(Retired Analyst/Programmer)Commented:
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
Chris Raisin(Retired Analyst/Programmer)Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RichardLudkiewiczAuthor Commented:
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
RichardLudkiewiczAuthor Commented:
We got there in the end, thank you very much
0
Chris Raisin(Retired Analyst/Programmer)Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB Dev Tools

From novice to tech pro — start learning today.