Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB6 IDE cannot load MSCOMCTL.OCX after update KB 2687323

Tags:

vb6

After windows update installed security update KB2687323, my VB6 project fails to load. Displayed error message is "'[project_vbp_path]/MSCOMCTL.OCX' could not be loaded--Continue Loading Project?". Note that the path in the messeage is the vbp file folder path instead of the control's registered path.

Details:

  1. MSCOMCTL.OCX is registered in the usual system32 folder.
  2. The executable produced by exactly the same project, an hour before the update runs fine and loads the updated MSCOMCTL.OCX (I have checked it with Process Explorer).

The security update description states that MSCOMCTL.OCX has a new fixed version. So I checked the project properties for "Upgrade ActiveX Controls" checkbox. I tried it both ways; checked and unchecked to no avail. VB6 IDE refused to load the upgraded OCX.

like image 598
Rumi Avatar asked Aug 16 '12 07:08

Rumi


People also ask

How do I activate Mscomctl OCX in Windows 10?

Run cmd in administrator mode, type "regsvr32 C:\Windows\SysWOW64\MSCOMCTL. OCX. This should solve the problem.

What is Mscomctl OCX?

MSCOMCTL. ocx is an ActiveX Control module that contains common controls used by Visual Basic and Windows, such as ImageCombo, ImageList, ListView, ProgressBar, Slider, StatusBar, TabStrip, ToolBar, and TreeView controls.


2 Answers

After hours of effort, system restore, register, unregister cycles and a night's sleep I have managed to pinpoint the problem. It turns out that the project file contains the below line:

Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX 

The version information "2.0" it seems was the reason of not loading. Changing it to "2.1" in notepad solved the problem:

Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0; MSCOMCTL.OCX 

So in a similar "OCX could not be loaded" situation one possible way of resolution is to start a new project. Put the control on one of the forms and check the vbp file with notepad to see what version it is expecting.


OR A MUCH EASIER METHOD:

(I have added this section after Bob's valuable comment below)

You can open your VBP project file in Notepad and find the nasty line that is preventing VB6 to upgrade the project automatically to 2.1 and remove it:

NoControlUpgrade=1 
like image 167
Rumi Avatar answered Oct 07 '22 15:10

Rumi


The problem has been resolved by running the following in elevated command prompt:

command :

cd C:\Windows\System32\ regtlib msdatsrc.tlb 

or

cd C:\Windows\SysWOW64\ regtlib msdatsrc.tlb 

I hope this helps.

like image 40
Auto Avatar answered Oct 07 '22 15:10

Auto