Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the proper source for Windows Common Controls 6.0 component (MSCOMCTL.OCX)?

Tags:

com

vb6

activex

I'm experimenting with writing ActiveX controls and noticed that I can't seem to create an ActiveX control in Visual Basic (6.0) which features slightly more sophisticated controls. Simple controls like labels, buttons and check boxes seem to work fine, but as soon as I try to add e.g. a tree control to my form, the ActiveX control stays entirely blank as soon as I embed it into some host application on another computer. It works fine on my development box though.

While going through the Projects->Components (Ctrl+T) list, I found two libraries which apparently contain a tree control:

  • Microsoft Windows Common Controls 5.0 (SP2)
  • Microsoft Windows Common Controls 6.0 (SP6)

As soon as I add any of the controls from these libraries to my form, the form stays entirely gray when embedded on another computer. The other computer is a Windows XP system, so I hoped that missing redistributables wouldn't be an issue, given how old Visual Basic 6 is. To be sure, I installed the VB6 redistributables, but unfortunately that didn't make a difference.

Does anybody know why my ActiveX control would stay gray on other computers, but not on mine, as soon as I add any of the controls from the above libraries to me form? FWIW I just need a tree control so if there is some other, more appropriate, library available - that's fine with me.

UPDATE: As it turned out, it helps to download MSCOMCTL.OCX into C:\WINDOWS\SYSTEM32 on the other computer and then registering it via regsvr32 C:\WINDOWS\SYSTEM32\MSCOMCTL.OCX. However, I didn't find an official source for this file, and running the COM registration by hand looks cumbersome to me. Is there really no redistributable I could use?

like image 724
Frerich Raabe Avatar asked Aug 04 '09 08:08

Frerich Raabe


People also ask

What are the Microsoft Windows common controls?

Like other control windows, a common control is a child window that an application uses in conjunction with another window to enable interaction with the user.

What is Mscomctl OCX used for?

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

VB6 runtime is preinstalled on XP and above but the Common Controls component you are referencing is not.

Try installing Microsoft Visual Basic 6.0 Common Controls redistributable on the client machines or event better make a setup for your application.

Edit:

Opps, the link is for an update that does not install the OCXs if not already present. The only redistributable I find is a merge module for Windows Installer.

like image 65
wqw Avatar answered Oct 05 '22 18:10

wqw


To solve this problem, I developed a .msi package. The source files (WiX) and stake posted here: https://github.com/IT-Service/ITG.VB6CommonControlsRedist

like image 43
Sergey S. Betke Avatar answered Oct 05 '22 18:10

Sergey S. Betke