Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
C++
CoInitialize(NULL);

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



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.
Posted
Comments
Rob Grainger 23-Aug-14 13:24pm    
Without seeing the server code that attempts to register the class object, it is impossible to know what is happening here.

The truths is: COM error are errors. (sounds nonsense but its true)

If you cant find the string in the registry than it isnt registered!!! :-O
Fix it! => Run the register as admin and check the error code. It must be NULL.

You better write:
C++
HRESULT hr = ptr.CreateInstance(TEXT("Server.Maths")); // To create  the co object.


Consider studying this fine article COM in plain C to better understand it. It is an outstanding article!!!
 
Share this answer
 
SOln is simple. I used COM in VC 6.0. Where progID would be created atoatically by the wizard, by saying modulename.component name. But in VS2010, it's not the case. During creation of Component, we need to manually provide the progID. This solves the problem.
 
Share this answer
 
Without runing register as admin, it'll never run:(
Already I have done that. I ran VS in admin mode while creating COM server. Else it'll throw error:)

Can you tell e where exactly to search the string? /ROOT/CLSID???? or anything else.i already did a entire search.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900