HOWTO: Delete and Re-Register the TypeLib GUID for an Active X Control

ID: Q217180


The information in this article applies to:
  • Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0


SUMMARY

IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

This article demonstrates how to delete and re-register the TypeLib GUID of an Active X Control. This procedure should be performed whenever you install and remove different Visual Basic versions so that your Visual Basic program can use the correct ActiveX control Type Library information. You may also wish to implement this procedure if you get the following error message:

<ActiveX Control File Name> Could Not Be Loaded - Adding component to project
This article assumes that you are familiar with editing the registry using the Registry Editor (Regedt32.exe or Regedit.exe) and with using the Run dialog.


MORE INFORMATION

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT, you should also update your Emergency Repair Disk (ERD).

To remove the Typelib GUID from the registry, you need to find the appropriate TypeLib GUID for your ActiveX control in the HKEY_CLASSES_ROOT\TypeLib folder. Once you find the GUID, delete the GUID and then register the control again using REGSVR32.EXE.

The following section demonstrates how to delete and re-register the ActiveX Control Microsoft Windows Common Controls 5.0 (comctl32.ocx).

Step by Step Instructions

  1. On the Start menu, click Run. Enter REGEDIT in the Open field and click OK to start the Registry Editor. Open the HKEY_CLASSES_ROOT\TypeLib folder.


  2. Right-click the folder, and then click Find on the sub-menu. The Find dialog box is displayed.


  3. In the Find what: field, enter the file name of the ActiveX Control you want to delete, and click OK.

    In this example, enter comctl32.ocx in the field and click OK. The folder key with the GUID for your control should appear in the left pane of the Registry Editor. Note that this folder may contain other folders with version numbers used as folder names. In our example, the GUID for comctl32.ocx is 6B7E6392-850A-101B-AFC0-4210102A8DA7. This folder may contain the folders 1.0, 1.1, 1.2, and/or 1.3, depending upon what has been installed on the system.


  4. Select the folder key and then press the DELETE key to delete this folder. In our example, select the 6B7E6392-850A-101B-AFC0-4210102A8DA7 folder and then press the DELETE key. You have just deleted the folder key for comctl32.ocx.


  5. Search for and delete other registry keys that refer to the ActiveX control.


  6. Close the Registry Editor. On the Start menu, click Run.


  7. Enter the following in the Open field, and then press the ENTER key:
    Regsvr32 <ActiveX Control File Name>
    RegSvr32 displays a message box indicating that the registration process was successful.

    In our example, you would type the following in the Run dialog and press the ENTER key:
    Regsvr32 comctl32.ocx
    The RegSvr32 message box is displayed with the following message:
    DllRegisterServer in comctl32.ocx succeeded.
    Click OK to close the RegSvr32 message box. The registration process is complete. If you do not see the message above, make sure that the ActiveX control file exists in your system directory and then run this step again.


Additional query words:

Keywords : kbActiveX kbRegistry kbVBp kbVBp500 kbVBp600 kbGrpVB
Version : WINDOWS:5.0,6.0
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: March 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.