Re: CoCreateInstance FAILED
Quote:
Originally Posted by
marco.bernasconi
What's the problem?
The problem can be understood from hr2 exact value, which you did not provide on some reason.
Most probably you do not initialize COM on the thread.
Besides, as long as you deal with CComPtr, your code might look just like
Code:
CComPtr<INVRAdapter> _adapter;
HRESULT hr = _adapter.CoCreateInstance(L"OnSSI.OCAdapter");
Re: CoCreateInstance FAILED
Quote:
Originally Posted by
Igor Vartanov
The problem can be understood from hr2 exact value, which you did not provide on some reason.
Thanks Igor,
The value is -2147221164.
Re: CoCreateInstance FAILED
It is REGDB_E_CLASSNOTREG (hex value 0x80040154):
Class not registered
Re: CoCreateInstance FAILED
Quote:
Originally Posted by
VictorN
It is REGDB_E_CLASSNOTREG (hex value 0x80040154):
Class not registered
Mmmh...in the registry (HKEY_LOCAL_MACHINE/SOFTWARE/Classes) I see OnSSI.OCAdapter.1.
I've registered it using regasm.
Re: CoCreateInstance FAILED
If it's in-process... Are you sure the bitness of your app is the same as the bitness of your registered COM object ?
you can't call a 64bit in-process COM object from a 32bit app and vice versa.
Re: CoCreateInstance FAILED
Quote:
Originally Posted by
OReubens
If it's in-process... Are you sure the bitness of your app is the same as the bitness of your registered COM object ?
you can't call a 64bit in-process COM object from a 32bit app and vice versa.
That's the trick!!!
:D
Thanks!!!
Re: CoCreateInstance FAILED
Quote:
Originally Posted by
marco.bernasconi
That's the trick!!!
What's the trick? HRESULT never lies. In case it says Class not registered, the class is not registered. 64-bit and 32-bit processes have different registry hives for COM class registration.
Re: CoCreateInstance FAILED
Quote:
Originally Posted by
Igor Vartanov
What's the trick? HRESULT never lies. In case it says Class not registered, the class is not registered. 64-bit and 32-bit processes have different registry hives for COM class registration.
I didn't know that there are different registries for COM class.
I'm not a guru in this field :)
Thanks for all!
Marco