views:

20

answers:

1

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.

+3  A: 

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. Project + Properties, Build tab, Platform target = x86.

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

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

The next approach is to call the supplier for support.

And then you give up trying to make it work.

Hans Passant
:) it is registered properly. I have registered the ocx which is in the installation directory, not the one under C:\Windows\SysWOW64\, is that correct? Regedit found that it is registered, under HKLOCALM\SOFTWARE\Classes\Wow6432Node\CLSID\{3A869226-B8CA-11D5-9ACF-004005495FCD}
vulkanino
you're right, I use a 64bit machine, but I compile for x86.
vulkanino
that was it! I had to set, in the advanced compile options, target CPU x86 instead of any, then *clean and rebuild the solution*, and now it works, you rock.
vulkanino