Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET COMException Interface non registered

I can't understand this. I want to use an OCX from this vendor http://www.mobyt.it/ to send SMSs. It is a dll and they provide usage examples in Vb, .NET, Visual C, etc.

The exception I get is:

System.Runtime.InteropServices.COMException (0x80040154): Interface not registered. (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

I'm breaking my mind. It looks like the COM object is not registered, but how should I register it? I've tried with regsvr32 with lo luck.

like image 472
vulkanino Avatar asked Mar 24 '26 07:03

vulkanino


1 Answers

Assuming it registered properly, a standard failure mode is running on a 64-bit version of Windows. COM servers like this are almost always only usable from 32-bit code. Right-click your EXE project > Properties > Build tab > Platform target = x86. Tick the "Prefer 32-bit" checkbox if available and enabled. Repeat for the Release configuration.

The next approach is to use Regedit.exe and verify that it was actually registered. Navigate to HKLM\Software\Wow6432Node\Classes\CLSID\{guid} where {guid} is the GUID that you got from the error message. On a 32-bit operating system, you'd find it in HKLM\Software\etc.

The next approach is to use SysInterals' ProcMon utility to observe your program searching the registry and trying to load the DLL.

The next approach is to call the supplier for support.

And then you give up trying to make it work.

like image 190
Hans Passant Avatar answered Mar 25 '26 21:03

Hans Passant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!