im trying to do an Atl Service in VS2008. I use the Atl Project Wizard and select Service (EXE). Then I add one AtlSimple Object. Compile & Register via /RegServer
From a client application I can CoCreate the AtlObject inside my .exe.
The Problem:
As soon as I register my service with cmd option -Service, I can no longer CoCreate the AtlObject. Any call to CoCreateInstance will run into a timeout and fail with 0x80080005 - "Server execution failed".
What am I doing wrong? Any ideas?
See attached my test project.
To reproduce:
rebuild AtlServerIII
start AtlClient
==>ok
run AtlServerIII -Service
start AtlClient
==>timout & error in CoCreateInstance
The only difference between -RegServer and -Service Options is that the Service adittionally calls CAtlServiceModuleT::Install() and uses ServiceManager to install the service... and... messes up my ATL Objects.
If I use sc.exe to install my service by Hand (instead of -Service option) everything will work... So *** is wrong with the ATL implementation??
Nobody any Idea about that?
(actually sc.exe also does not really work...)
So the question basically is how do I implement an ATL Service containing a simple COM object wich can be instantiated from another app?
This worked perfectly in vc6 but not in VS 2005/2008
As it turned out, the problem is due to a bug in VS2008 : The registration Script (.rgs) generated by the Wizard is incorrect. Value "AppId" is missing.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.