Improve company productivity with a Business Account.Sign Up


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
  • 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?
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.


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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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 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…

606 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