Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17



Posted on 1999-08-02
Medium Priority
Last Modified: 2013-12-25
I've got VB5 Ent. I have a project that I was working on at another machine. I was using the Microsoft Common Controls - 5.0 (comctl32.ocx). When I try to open the project on this machine it says it can't load comctl32.ocx. It will allow me to add the ocx and add treeviews and such on forms but all of my existing controls are now PictureBoxes. I have seen this before and I normally just replace all of the controls and rename them but this is starting to be a big hassle, especially with the size of this particular project. Does anyone know of a way to get around this without having to add all of the controls and rename them again?

Did that make sense?

I've looked in the vbp file and the path to comctl32.ocx is right. I can open it fine on the old machine but not on this one..
Question by:jmnolan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 12

Expert Comment

ID: 1495792
Just copying the files from one machine to another is NOT sufficient. You have to register them. When you install VB, it registers all the controls at that time. If your project uses an unregistered control you'll get this error even if you can see the .OCX just fine.

Use REGSVR32 to register the OCX.



Author Comment

ID: 1495793
The control is registered. I installed VB5 on this machine. I can add listviews and treeviews and all of the other common controls to an empty form. I do not believe that this is a registration problem, as I have seen those before and this is something different.

Author Comment

ID: 1495794
Here is the exact message:

'\\..\..\..\comctl32.ocx' could not be loaded--Continue Loading Project?

I get this when I first open the project. The Common Controls are not in the toolbox as they should be. This always happens to me when I try to open an existing project with a new install of VB.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 12

Expert Comment

ID: 1495795
The .VBP has a set of pointers in it to the files and their locations. It also contains the GUID's. If either doens't match, you'll get errors like this. Try manually editing so that path is correct and see if that helps.



Expert Comment

ID: 1495796
i have gotten this before. somehow when a vb project is brought up on another machine, it "looses" some of the controls you've included. this is what i have discovered. when you load the project and you get one of these messages, note the offending ocx name. after the project is loaded, goto project/components and readd them. don't do anyting else to your project until this is done. after you've completed it, it "should" run as expected. if it does, save the project.

i have no idea why this occurs. its frustrating.


Author Comment

ID: 1495797

That didn't work. I know where you're coming from though. After I add the component back in and load a form, all of the listviews are gone.

Here is a little more information:

in the log file for a form:
Line 35: Class ComctlLib.ListView of control lvListView was not a loaded control class.

First two lines of the .frm file:
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "comctl32.ocx"

Line 35:
   Begin ComctlLib.ListView lvListView

If the GUID is incorrect, how do I go about getting the right one?


Expert Comment

ID: 1495798
Your problem is that you have installed something which has overwritten COMCTL32.OCX version 5 with COMCTL32.OCX version 6, and it has probably overwritten COMDLG32.OCX and COMCT232.OCX also.
The easiest way to fix this is by installing VB6.

If that is not possible then do this:

1)Find the 3 files mentioned above from someones elses computer and make sure they are version 5, which you can check in the file properties

2)Delete the above 3 files out of your WINDOWS\SYSTEM directory.

3)Run Regclean.exe which you can download at MICROSOFT.COM

4)Reboot System

5)Copy the version 5 files back into the WINDOWS\SYSTEM directory

6)Run REGSVR32.EXE on the 3 files.

Messy but it does work.

Author Comment

ID: 1495799
comctl32.ocx version:  5.00.3714

I have seen this problem before VB6 was ever released...

COMDLG32.OCX and COMCT232.OCX are the same version too...

Expert Comment

ID: 1495800
Is the same service pack installed on both machines?

When you copied the project over, did you copy the frx files or just the frm files. (I've done that before with sad results. ;-) )

In one of the support subdirectories on your VB5 installation CD, there is a .reg file that registers the  licenses for all of the controls. Double clicking on that file is worth a try.

Accepted Solution

JaganMohan earned 200 total points
ID: 1495801
This is very common problem. Here is a simple solution.
Even though error comes "\\..\..\..\comctl32.ocx' could not be loaded--Continue Loading Project? " load the project.

Then select comctl32.ocx in the Project->Components section and save the project. Here is the trick when save message comes up with all the forms list and vbp name, deselect all the forms and choose only vbp and press save.

Again open the project...No problem.

If you have still problem with the control. Use Regsvr32 to register this control first.

Author Comment

ID: 1495802

That's what I was looking for! Thanks!

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

715 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