When you attempt to run a program created using Visual Basic (classic VB) on a Windows 11/10 computer, the following error may occur:
Run-time error '339': Component 'COMCTL32.OCX' or one of its dependencies not correctly registered: a file is missing or invalid
Let’s see how to fix this error on any version of Windows, including Windows 11.
Note: There are two versions of the Microsoft Windows Common Controls. Comctl32.ocx contains Windows Common Controls 5.0 and was included with Microsoft Visual Studio 5.0. Mscomctl.ocx contains Windows Common Controls 6.0 and was included with Visual Studio 6.0.
Fix for Error COMCTL32.OCX missing or not registered
First, check if the file
COMCTL32.OCX exists in the following folder:
If you’re using Windows 64-bit edition:
If you’re using Windows 32-bit edition:
COMCTL32.OCX exists in the above location, then all you need to do is register the module using
To register the module, open an administrator Command Prompt window and type the following command:
For Windows 64-bit systems:
For Windows 32-bit systems:
You should see the following output/message:
DllRegisterServer in comctl32.ocx succeeded.
RegSvr32.exe throws the error 0x8002801c?
If the above command-line throws the error 0x8002801c, it means that the command was unable to write to the registry successfully. This happens if you run the command from a normal Command Prompt instead of the admin or elevated Command Prompt.
The module "comctl32.ocx" was loaded but the call to DllRegisterServer failed with error code 0x8002801c. For more information about this problem, search online using the error code as a search term.
To resolve the error 0x8002801c, re-run the command-line from admin Command Prompt.
COMCTL32.OCX Missing? Download it now
If COMCTL32.OCX is missing from the Windows\System32 or Windows\SysWOW64 directory, you’ll receive the following error when running the RegSvr32.exe command-line:
The module "C:\Windows\SysWOW64\comctl32.ocx" failed to load. Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files. The specified module could not be found.
In that case, you’ll need to download the module and save it to
C:\Windows\System32 (for Windows 64-bit computers) or
Windows\SysWOW64 folder (for Windows 32-bit computers).
The most recent version of
v6.01.9839. It’s included in
VB60SP6-KB3096896-x86-ENU.msi (Microsoft Visual Basic 6.0 Service Pack 6 Security Rollup Update 1/8/2016) package from Microsoft Corporation. Here’s the download link:
- Once downloaded, open the MSI package using the freeware 7-Zip utility.
- Extract/copy the module
COMCTL32.OCXand save it to the
Windows\SysWOW64folder. On Windows 64-bit systems, extract the OCX file to:
C:\Windows\SysWOW64. On Windows 32-bit systems, extract the OCX file to
- Then register the module using RegSvr32.exe command-line as explained at the top of this article.
COMCTL32.OCX – File Information
Filename : COMCTL32.OCX Verified : Signed Publisher : Microsoft Corporation Company : Microsoft Corporation Description : Windows Common Controls ActiveX Control DLL Product : COMCTL Prod version : 6.01.9839 File version : 6.01.9839 MachineType : 32-bit MD5 : 2640ad05ab39321e6c9d3c71236ca0df SHA1 : 03d30b572f312c2b554e76b3a18fbbb4a38a9be4 SHA256 : 634d27df20591de4d9b44dfb7f1ef03284c1d120f61b0801d668c1076d72cb6d
Note that the MSI package contains the following OCX files among many other files inside the archive:
What is COMCTL32.OCX?
COMCTL32.OCX is a 32-bit module used by developers when creating applications using Visual Basic. COMCTL32.OCX module doesn’t ship with Windows, by default. Microsoft has informed that this module will be supported in Windows 11 (and earlier), but it has to be shipped along with the respective software. This means that the module won’t be available via WinBIndex.
For more information, see the section named “Supported runtime files to distribute with your application” in the article Support Statement for Visual Basic 6.0. Even now, there are lots of users who run their old VB apps on Windows 11/10.
I hope this article helped you resolve the COMCTL32.OCX error and run your classic VB apps successfully.
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!