Solved

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

Posted on 2001-06-28
12
620 Views
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.
0
Comment
Question by:tlw2651
  • 3
  • 2
  • 2
  • +4
12 Comments
 
LVL 3

Expert Comment

by:jrspano
ID: 6235112
have you tried checking the upgrade active x controls in the project properties?
0
 
LVL 3

Expert Comment

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

Expert Comment

by:rspahitz
ID: 6235138
How about the file date?
0
 
LVL 8

Expert Comment

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

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

Cheers
0
 
LVL 5

Expert Comment

by:dredge
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.
0
 

Author Comment

by:tlw2651
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...
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

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


Comctl32.ocx


Comct232.ocx


Mschart.ocx


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

Mscomctl.ocx


Mscomct2.ocx


Mschrt20.ocx


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.



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



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


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

http://msdn.microsoft.com/vbasic/downloads/download.asp?ID=088



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:

       ComctlLib.ImageList

   To:

       MSComctlLib.ImageList
 



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.



NOTE:

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.



0
 
LVL 8

Expert Comment

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

:)
0
 

Author Comment

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

Thanks
0
 
LVL 16

Expert Comment

by:GUEEN
ID: 6237287
Experts:
This question has a request for closure since the poster found the answer within MSDN (see here:)
http://www.experts-exchange.com/jsp/qShow.jsp?ta=commspt&qid=20143022

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

Ciao~
Bev
0
 
LVL 5

Expert Comment

by:dredge
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.
0
 
LVL 1

Accepted Solution

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

Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now