Link to home
Start Free TrialLog in
Avatar of Wanting2LearnMan
Wanting2LearnManFlag for United Kingdom of Great Britain and Northern Ireland

asked on

CoCreateInstance - Class not registered

I'm following the following tutorial:
http://www.codeguru.com/cpp/com-tech/activex/tutorials/article.php/c5567

I have built the dll and I am trying to run the client C++ program to access the dll.

CodeGuruMathLib::IAddPtr pFastAddAlgorithm;
pFastAddAlgorithm.CreateInstance("CodeGuru.FastAddition");

Open in new window


First of all:
1. My dll is registered properly as I add the following in the post build event: regsvr32 ..\Debug\AddObj.dll
2. When I look in the registry I see the entry:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{92E7A9C2-F4CB-11D4-825D-00104B3646C0}\ProgId\CodeGuru.FastAddition
so this indicates to me that it has registered properly.

Now when I step into the function pFastAddAlgorithm.CreateInstance above I get to:
hr = CoCreateInstance(rclsid, pOuter, dwClsContext, __uuidof(IUnknown), reinterpret_cast<void**>(&pIUnknown));
but hr = Class not regstered.

Why could this be??

Thanks
SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial