Question

I have a VB6 application I am trying to get working on a Windows 7 environment, however every time I start the application, I get the error:

"Component 'ComCt332.ocx' or one of its dependencies not correctly registered: a file is missing or invalid".

To resolve, I have tried to register the comct332.ocx file by running the regsvr32 in the Command Prompt in Administrator Mode but then I get the error:

"The module "comct332.ocx" was loaded but the call to DllRegisterServer failed with error code 0x80004005"

Other things I have tried include:

  • Deleting all parent nodes in the registry where 'comct332.ocx' exists and running regsvr32 again in Admin Mode. Same result.

  • I granted admin permission to another user on the PC and I could register the file successfully, and the application starts and runs successfully! However when I log in as the previous user again, it fails miserably.

Any help, thoughts, other-things-to-try will be much appreicated. Thanks

Was it helpful?

Solution

If you have been keeping up on things as you must if you are to continue using VB6 successfully there are a number of things you'll be aware of.

  • One of these is the impact of UAC and per-user registry virtualization.

  • Another is the impact of SysWOW registry redirection on 64-bit systems.

You will understand that proper installation packages are more important than ever before. Windows has many auto-remediations for legacy software but some of them will not result in applications having all of the originally intended behaviors. Most of them will only be applied when your application "follows the right path" from installation to second run.

Here we have a case that is intended to be handled through use of a proper Windows Installer package, or at least a legacy setup recognized as such through Windows' "legacy installer detection heuristics." In general legacy scripted setups are deprecated but as long as they stay on the path Windows makes efforts to ensure they succeed.

Manually deploying by just copying over a bunch of files and randomly running regsvr32 on some of them has a reduced chance of success. This was never an approved method of deployment anyway.

You have most likely run afoul of some combination of registry virtualization and redirection.

The regsvr32 utility is a development tool, not a deployment tool. If you insist on trying to use it for deployment you must follow the same rules a developer must follow:

  • Run the correct version. On a 64-bit system there are both 64- and 32-bit versions of this utility. The 32-bit version which you must use is located in the SysWOW64 folder.

  • Run it from an elevated command prompt. An easy way to start one is to type <Winkey>cmd.exe<Ctrl-Shift-Enter> then approve the UAC prompt or provide over-the-shoulder admin credentials as needed.

There are many other things you need to know and handle in order to be successful. If you have ignored those most of them will only become apparent to you after your program gets installed and will run. A lot of them stem from filesystem virtualization.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top