Click here to Skip to main content
15,885,078 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi.

I have been working 2 days on creating a simple exe COM server, I have test any thing in the web , but still not working! I create a simple object with ATL and register the interface with ATL RegisterClassObjects and RegisterActiveObject, it returns succeed but any clients can't use GetObject method to get the object, but CreateObject works.

here is my project files: http://www.mediafire.com/?365arde4jyd5v3x
I used this code is main function to register a created instance of my object:

C#
hr = __objMap_CMySimpleObject.RegisterClassObject(CLSCTX_LOCAL_SERVER,ACTIVEOBJECT_STRONG);


and also get instance by this way:

XML
IMySimpleObject *mysim = NULL;
hr = CComCreator<CComObject<CMySimpleObject>>::CreateInstance(NULL,IID_IMySimpleObject,(void**)&mysim);


and registered it with:

C#
hr = RegisterActiveObject(mysim,CLSID_MySimpleObject,ACTIVEOBJECT_STRONG,&res);


but after all this function returns error:

C++
hr = ProgIDFromCLSID(CLSID_MySimpleObject,&pgid);


should I use any ATL macro in my class or do any thing else?


Can anybody help me? I really need it, it's a part of my project.
Any helps would be appreciated.
Thanks.
Posted
Updated 2-Sep-11 0:54am
v3
Comments
Paul Heil 2-Sep-11 14:30pm    
What is the error code returned by ProgIDFromCLSID() ?
Mohammad Zatkhahi 2-Sep-11 16:26pm    
this will return "Class not registered" error.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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