[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


How to distinguish between MS Common Controls (5.0 & 6.0)

Posted on 2001-06-28
Medium Priority
Last Modified: 2007-11-27
Can anyone tell me how to distinguish between Common Controls 5.0 and Common Controls 6.0?  We have a number of programs that we are in various stages of upgrades and having 2 different versions of a  control (e.g. toolbar) in the same project can lead to some problems.  Baring the ability to upgrade the controls en masse how do I identify them so that I can update them manually.  (True DBGrid comes with a wizard to do this.  Is there something similar available for MS?)

I am using VB 6.0 Enterprise edition with Service Pack 6.
Question by:tlw2651
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
  • 3
  • 2
  • 2
  • +4

Expert Comment

ID: 6235112
have you tried checking the upgrade active x controls in the project properties?

Expert Comment

ID: 6235120
it probably won't work since they are two separate controls in the controls list, but it's worth a try.
LVL 22

Expert Comment

ID: 6235138
How about the file date?
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 6235242
The physical file names are different...

Common controls 5 - comctl32.ocx
common controls 6 - mscomctl.ocx


Expert Comment

ID: 6235249
creat a copy of your project.

Open the copy, and in the Project Components, remove the v5.0 controls.

Save the project copy and close it.

Open the project copy again, and see which items on your forms are no longer valid.

make notes on each one of these items (what form it's on, what the object name is, what is in the object, etc.)

now, go back to your original copy of the project. Open it up, and go through one by one, to remove the v5.0 objects that you wrote down, and replace them with 6.0 objects.

once you're done with this, you can remove the v5.0 reference in the Project Components.

Author Comment

ID: 6235533
I have the "Upgrade ActiveXControls" and "Remove information about unused ActiveXControls" checked.  But, as Dave Greene pointed out they have different names.

As for drege's suggestion... it won't work because the components are in use.  So it doesn't matter whether I make a copy or not.

The program has 28 forms, each one of which has between 1 and 20 v 5.0 or v 6.0 ActiveXControls.  

If there were an easy way to identify which version each one is my problem would be mostly solved.

Thanks for the brain storming...

Author Comment

ID: 6235603
The following controls are not automatically updated when a Visual Basic 5.0 project is loaded by Visual Basic 6.0:




You must manually upgrade the project to the new Visual Basic 6.0 controls:




NOTE: The "Upgrading Applications that Use the Windows Common Controls" topic in the Visual Basic documentation incorrectly states that these controls are automatically upgraded. Specifically, the following statements are in error:

When an application - created with Visual Basic version 5 and using these controls - is first loaded in Visual Basic version 6, a dialog box will appear informing you that a new version is available, and that the controls can be upgraded. At that time, you can choose to upgrade the project to the new controls, or continue to use the older control versions.

This behavior is by design. The new controls are not backward compatible with the older versions and, in accordance with the rules of COM, were given new file names and new GUIDs. This prevents your application from breaking existing applications that use the older controls. Because the new controls have new names and GUIDs, they also have new Typelibs. When you load a Visual Basic project, it checks the Typelib version. However, Visual Basic does not know the Controls were updated because the Typelib for the new controls have a different GUID than the Typelib for the old controls.

To upgrade a project to the newer version, do one of the following:

Download the ActiveX Control Update Utility from the following Web site:


Manually update your project and from files using the following steps:

Open the .vbp file in a text editor, such as Notepad, and change the lines that reference the old version of the .ocx to the following:

      Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX
      Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCT2.OCX
      Object={65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0; MSCHRT20.OCX

Save and close the .vbp file.

Open any .frm file (or .ctl file) that uses one of these controls in a text editor, and change the lines that reference the old version of the .ocx to the following:

    Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
    Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
    Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"

Change all text that references the old libraries to the new library names. You need to replace ComCtlLib, Comctl2, and MSChartLib with MSComCtlLib, MSComCtl2, and MSChart20Lib. For example, change:




Save and close the file. When you open the project in Visual Basic 6.0, it will use the new Mscomctl.ocx, Mscomct2.ocx or Mschrt20.ocx controls.


IMPORTANT: Before you edit your .vbp, .frm, or .ctl files, you should backup all of the files in your project.

While the objects listed in step 1 and 2 are very similar, they are not identical and the upgrade will not work properly if each is not copied exactly to the correct file.

If you get a message stating that the header is corrupt when you attempt to load the project, you have probably made a copy error. Please go to your backup and repeat the process.

If you prefer to continue using the older versions of these controls, Comctl32.ocx and Comct232.ocx are included on the Visual Basic 6.0 product CD-ROM in the \OS\System directory. Mschart32.ocx resides in the \Common\Tools\VB\Controls directory.


Expert Comment

ID: 6235605
Open the VBP up in notepad and check the references...


Author Comment

ID: 6235694
I just downloaded and ran the MS Upgrade utility.  It worked great.

LVL 16

Expert Comment

ID: 6237287
This question has a request for closure since the poster found the answer within MSDN (see here:)

As the moderator (Moondancer) requested she would like expert input (as it should be) prior to granting said request. . .


Expert Comment

ID: 6238109
if the answer was not found within the comments of the experts on this question, then there is no reason to leave the question open.

Accepted Solution

Moondancer earned 0 total points
ID: 6238221
Thank you for your updates, and thank you, Bev for the help.  This question will be refunded and moved to the PAQ, since it has both the problem and solution posted by client.

Community Support Moderator @ Experts Exchange

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 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