Applies to: TwainControlX

Last updated: 02 December 2018

Class not registered error (REGDB_E_CLASSNOTREG)

When running a Visual Studio project containing TwainControlX from the IDE, an error message can be encountered as shown in the image below. The full error message is typically ‘Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))’.

Class not registered error

This error is most commonly caused by attempting to compile and run a project as a 64-bit application when only the 32-bit version of TwainControlX is installed. While developing the project in the Visual Studio IDE, everything appears to work correctly. This is because Visual Studio itself is a 32-bit application. When compiling, the default option in VS is to compile to 64-bit when working on a 64-bit operating system, so at this point, the execution fails.

The possible solutions are:

If you are using a version of TwainControlX older than version 4.0 (released in 2013) please note that there is no 64-bit OCX available. Consider building your application as 32-bit, or upgrading to the latest version of the control.