About   -   Contact   -   Purchase   -   Search   -   What's New

A frustrating occurrence for Visual Basic 5 users is when suddenly, for no apparent reason Visual Basic 5 refuses to load in COMDLG32.OCX, COMCTL32.OCX, or COMCT232.OCX.

Instead the error message 'Could Not Be Loaded' is given despite such files existing in the system directory and VB 5 knowing the correct names of the files. This means that you are not able to use the common dialog controls: toolbar, status bar, image list, progress bar, tree view, list view, slider, etc. Therefore, the updated article below is intended for VB 5 programmers who encounter this problem. In addition, another article kindly provided by Amy Carlstrom, has been provided to offer an alternative solution.

Here's an important paragraph from Microsoft Knowledge Base article Q217017 (http://support.microsoft.com/support/kb/articles/q217/0/17.asp) concerning the above error message: This error message occurs when you install a newer version of an ActiveX control, uninstall it, and then install an older version of the same ActiveX control. The registry key for the newer version of the ActiveX control remains in the registry and Visual Basic 5.0 is now trying to use that registry key. This could easily happen, for example, if you install a recent shareware program and later uninstall it. The key point is that although the earlier version of the OCX is restored, the Windows registry still points to the later version of the OCX and since it is no longer there, VB 5 is unable to load it.

To fix the problem, the Knowledge Base advises using RegClean, making the point: RegClean will only be effective if Comctl32.ocx is deleted from the system before running RegClean.

Although not mentioned by the article, it appears that comdlg32.ocx and comct232.ocx should also be temporarily deleted before running RegClean. For details on using RegClean, see the general tools section of this Microsoft TechNet article.

Unfortunately, the RegClean utility itself can be downloaded from the Microsoft site as stated in the TechNet article above, but instead can be found on many FTP search engines, such as Lycos, by searching on RegClean.exe.

Here are the specific steps to take to solve the problem:

1. Download RegClean from the Microsoft site.

2. Send the three com*32.ocx files to the Recycle bin.

3. Unzipped and run RegClean to repair the registry.

4. Restore the three com*32.ocx files from the Recycle bin.

5. Use Regsvr32.exe to register the three com*32.ocx files.

6. Test VB to confirm that things are working again.

7. Reinstall the Visual Basic 5 Service Pack 3 (good practice after you using RegClean).

Reason: If you install a shareware program and then uninstall the program, you run the risk of corrupting the registry for VB 5. This is because when you install the program, it may replace an older OCX with a newer version, and when you uninstall it, it will replace the newer OCX with the older version, but without fixing the registry.


Top of Page

Legal Notice

Ken Howe 2011