Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3029

CoCreateInstance FAILED

$
0
0
Hi all,

I'm following a sample from a third part SDK.

In particular this piece of code:


Code:

CComPtr<INVRAdapter> _adapter;

CLSID clsOCAdapter;
HRESULT hr1 = CLSIDFromProgID(L"OnSSI.OCAdapter.1", &clsOCAdapter);

HRESULT hr2 = CoCreateInstance(clsOCAdapter,
                NULL,
                CLSCTX_INPROC_SERVER,
                __uuidof(INVRAdapter),
                (void**)&_adapter);

if (FAILED(hr2))
{
//code
}


The result is that hr2 is negative, so it fails.

I've checked in the registry and the OnSSI.OCAdapter.1 record exists.


What's the problem?

Thank you very much!

Viewing all articles
Browse latest Browse all 3029

Latest Images

Trending Articles



Latest Images