• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 652
  • Last Modified:

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

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.
  • 3
  • 2
  • 2
  • +4
1 Solution
have you tried checking the upgrade active x controls in the project properties?
it probably won't work since they are two separate controls in the controls list, but it's worth a try.
How about the file date?
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

The physical file names are different...

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

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.
tlw2651Author Commented:
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...
tlw2651Author Commented:
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.

Open the VBP up in notepad and check the references...

tlw2651Author Commented:
I just downloaded and ran the MS Upgrade utility.  It worked great.

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. . .

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.
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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now