DOCUMENT:Q190952 07-AUG-1998 [vbwin] TITLE :HOWTO: Upgrade Project to Use the New MSCCOMCTL.OCX in VB6 PRODUCT :Microsoft Visual Basic for Windows PROD/VER: OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 6.0 --------------------------------------------------------------------- SUMMARY ======= The following controls are not automatically updated when a Visual Basic 5.0 project is loaded by Visual Basic 6.0: COMCLTL32.OCX, COMCT232.OCX, and MSCHART.OCX The project must be manually upgraded to the new Visual Basic 6.0 controls: MSCOMCTL.OCX, MSCOMCT2.OCX, and MSCHRT20.OCX, respectively. MORE INFORMATION ================ 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, you must do the following: 1. Open the VBP file in a text editor, such as Notepad, and change the line(s) 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. 2. Open any FRM file (or CTL file) that uses one of the above controls in a text editor, and change the line(s) 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" 3. Change all text that references the old libraries to the new library names. This means that you need to replace ComCtlLib, Comctl2, and MSChartLib with MSComCtlLib, MSComCtl2, and MSChart20Lib. For example, change: ComctlLib.ImageList to: MSComctlLib.ImageList 4. Save and close the file. When you open the project in Visual Basic 6.0, it will use the new MSCOMCTL.OCX, MSCOMCT2.OCX and/or MSCHRT20.OCX controls. NOTE: 1. IMPORTANT: Before you edit your VBP, FRM, or CTL files, you should backup all of the files in your project. 2. 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. 3. 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. 4. 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. (c) Microsoft Corporation 1998. All Rights Reserved. Contributions by Brian Combs, Microsoft Corporation. Additional query words: kbVBp kbdsd kbDSupport kbVBp600 kbComCtrls ====================================================================== Platform : WINDOWS Issue type : kbhowto ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.