A .Net program that calls Barcode ActiveX worked fine on 32-bit Windows. However, it does not start on Vista 64-bit, or throws an unhandled exception. The error code is REGDB_E_CLASSNOTREG.
The Barcode ActiveX control has been copied to the target machine and registered correctly.
By default, Visual Studio compiles .Net program under “Any CPU” setting, which generates x64 executable on a 64-bit PC and x86 executable on a 32-bit PC. However, Morovia Barcode ActiveX 3.x binary are x86 format only and can't be loaded into a x64 executable. Therefore, when running on x64 Windows, the .net run time throws an exception that complains that it can not locate Barcode ActiveX control.
When compiling programs that calls 32-bit DLLs, including COM objects, change the target CPU from “Any CPU” to “x86” and rebuild the program.
To change the target CPU, perform the following steps (in Visual Studio 2005):
Right click on the project and select
.click on Compile tab and click on button.
In the Target CPU combo box, change it to x86.