Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
Hi.
I have been searching over the internet for a C++ COM server code, but I didn't find any thing. There are lots of C# or VB codes but no C++ ones.
Can any body help me write a simple server?

I created a simple EXE ATL project with Visual Studio 2010 and added SimpleObject as ATL class to it. It appears that it runs correctly but I can not access to a created instance object with VB. (I mean late binding no early)
for example I wrote:
GetObject(',"TestServer.SimpleObject")

it does not work. but :
set t = New TestServerLib.SimpleObject
works.

What should I do in ATL project? why SimpleObject interface is not registered?

here is my sample project file:
http://www.mediafire.com/?365arde4jyd5v3x

any working file or sample can help me.
Thanks.
Posted

1 solution

Before you can use GetObject you'll have to register your ActiveX control. When it's an exe it will register itself when you run it the first time. If it's an ocx or dll you'll register it using regsvr32 e.g. regsvr32 C:\Full\Path\myActiveX.dll.

Remember you'll need run the ActiveX exe or command prompt with admin rights.
 
Share this answer
 
v2
Comments
Mohammad Zatkhahi 3-Sep-11 2:38am    
OK. But it is not a DLL file. I don't need to register it with regsvr32. the problem is why my exe file don't register it itself? my project file is uploaded, would you test it?
I even register objects in main function by RegisterActiveObject method. but still not working.

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