CreateInstance() fails with error code 1008 in C++ COM

Visual Studio 2010 ULTIMATE - To create both server and client.
OS: VISTA

Module name : Server
Component Name: Maths

I'm trying the following to use the com component.

CoInitialize(NULL);

IMathsPtr ptr;
HRESULT hr = ptr.CreateInstance("Server.Maths"); // To create  the co object.
// here I am getting Invalid class string - during debugging

Open in new window


I have registered the COM component in the registry. During building Server app, it automatically registers.
Also tried with regsvr32 to register.
But here my Question is how to get the valid class string fro registry or any other way.
In Visual studio 2010 ultimate, I am not finding any option for OLE Object viewer!!!

Any body having any point on this, please share.

FYI: I searched this in registry, couldn't find.

Thanks,
Subrat.
LVL 9
Subrat (C++ windows/Linux)Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
Stupif question - what does 'CoInitialize()' return? Chances are that this call returns an error condition and that 'ERROR_NO_TOKEN' (1008) is unrelated.
0
Subrat (C++ windows/Linux)Software EngineerAuthor Commented:
CoInitialize() is Success.
0
Subrat (C++ windows/Linux)Software EngineerAuthor Commented:
In visuAL STUDIO 2010, it's not generating progid/CLSID as modulename.componentname ex:Server.Maths here.
So I was getting error in client while trying to use this progid.

Create progid mannually during creation of ATL Simple COM Object, solves the problem.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Subrat (C++ windows/Linux)Software EngineerAuthor Commented:
Root cause and soln is provided.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.