Wednesday, February 17, 2010

.NET Error: Class not registered Exception from HRESULT: 0×80040154

This error might occur when an ActiveX control is not registered in the machine. For example, the DSO Framer control (an ActiveX control to host office file) works fine in the local machine. After deployment in another machine, it might throw the error: “Class not registered

Reason:
An AciveX control needs to be registered before it can be used

How to register the active-x control?

1) Using regsvr32.exe (Manual registration)


The active-x control needs to be manually registred in that machine by using regsvr32.exe.
Go the the DOS prompt and type in "regsvr32.exe c:\DSOFramer.ocx".


2) During Deployment: (Best option)


1. Add the dsoframer.ocx in your Setup project
2. Set the Register property of this file to vsdrfCOM.
3. Build the Setup project and run the resulting MSI package to install your application as well as the DSOFramer ActiveX control on the target machine.

    No comments:

    Post a Comment