Link to home
Start Free TrialLog in
Avatar of PingPhotonics
PingPhotonicsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Error 0x80040201. Failing to register *.ocx file in 64-bit Windows 7

Im trying to transfer a 32-bit C++ ActiveX control (developed using Visual Studio 2003 on a Windows XP machine) to 64-bit Windows 7 using Visual Studio 2008.

Ive set the output for the both the solution and the single project it contains to x64.

The solution compiles and the file Numpty.ocx is generated OK!

The problem occurs when I try and register the control. I tried registering using regsvr32.exe. I tried both versions of this executeable. ie. The one in C:Windows\System32 and the one in C:\windows\SysWOW64 and got the following error in each case;

"The module "Numpty.ocx" was loaded but the call to DLLRegisterServer failed with error code 0x80040201"

This error does not occur in Windows XP.

Note Ive also tried adding the regsvr32 step in the "Custom Build Step" of the project and get the following error;

error PRJ0019: A tool returned an error code from "Registering ActiveX Control..."

Any ideas? Ive tried googling but although there is some discussion Ive not managed to fix it. One common solution is to make sure you are logged in as an administrator which I am.
SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PingPhotonics

ASKER

How do you "run cmd as administrator"?
 I get "cmd" to run ok but I just type "cmd". And I think I am already logged in as administrator (by looking at the control panel)
According to the link I provided (same instructions as from the other expert) there is nothing about running cmd as admin - try it without first.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Dan. It registers OK now. It doesn't work when I add it to a 64-bit application but that's another question.