Hi,

I working on COM Components in VC++.NET 2005,

HRESULT hr = spCrypt.CoCreateInstance(__uuidof(Cryptographer::TMMPlayerHelper), 0);
    if( FAILED(hr) )
        spCrypt = 0;

I am facing an error here.

I debug the code and found that "CoCreateInstance()" is returning a message

"Class is not registered"

an my program gets crash.

How can I resolve this problem? Please reply me soon.

--
Regards,
Asif

Whose class is Cryptographer ? Is it registered ?

Whose class is Cryptographer ? Is it registered ?

Hi,

Cryptographer is a namespace. and it has different structs and classes. TMMPlayerHelper is declared as struct in this namespace.

I did not perform any registration step because i did not know how to register it?


--
Regards,
Asif

COM only works with ActiveX components or Windows Services programs, all of which must be registered before they can be used. Here is how to register them. If that registration fails then its not written as a COM component and therefore can not be used the way your attempting to use it.

COM only works with ActiveX components or Windows Services programs, all of which must be registered before they can be used. Here is how to register them. If that registration fails then its not written as a COM component and therefore can not be used the way your attempting to use it.

Thanks a lot.
Ancient Dragon. you have solved my problem. I have register the required dll and now its working perfectly.

--
Regards,
Asif

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.