Re: ATL Service & InitializeSecurity

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 09/20/04


Date: Mon, 20 Sep 2004 15:32:13 -0700

Yes, service startup problems are notoriously hard to debug...
Insert code to log (into a file for example) checkpoints in the
service startup code to see how far you progress. This should
help you narrow down where you get stuck. You can then
post that piece of code and we can pore over it in the group.

BTW, if your service does not start whatsoever for a COM
client, you have a COM registration problem.

-- 
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"khalprin" <khalprin@discussions.microsoft.com> wrote in message 
news:8C281129-A1ED-4CE7-85C2-7DB28F5B931D@microsoft.com...
> Yes, it does start when I start it from the services applet. However...
>
> When registered as a service, a client cannot start it when calling
> CoCreateInstance() to get an interface from it.
>
> When registered as a local server, a client can start it when calling
> CoCreateInstance() to get an interface from it.
>
>
> "Alexander Nickolov" wrote:
>
>> Does your service start? Can you start it successfully from the
>> services applet? CoInitializeSecurity doesn't seem to be relevant
>> to your problem.
>>
>> -- 
>> =====================================
>> Alexander Nickolov
>> Microsoft MVP [VC], MCSD
>> email: agnickolov@mvps.org
>> MVP VC FAQ: http://www.mvps.org/vcfaq
>> =====================================
>>
>> "khalprin" <khalprin@discussions.microsoft.com> wrote in message
>> news:1E5CB341-EC4B-4AB2-8F6D-6A334CBCDAA9@microsoft.com...
>> > This is giving me fits... I'm using Visual Studio .NET 2003. I've 
>> > created
>> > a
>> > non-attributed service with one interface exposed. I can use
>> > CoCreateInstance() from a client and call the interface when the ATL
>> > service
>> > is registered as a local server instead of a service.  When the ATL
>> > service
>> > is registered as a service, the client's CoCreateInstance() returns
>> > 'server
>> > execution failed'.  I've tried this with the default 
>> > InitializeSecurity()
>> > in
>> > the ATL service - which does nothing.  And I've tried it by calling
>> > CoInitializeSecurity() in the IntializeSercurity() method with a null
>> > descriptor.  The dcom settings look right - the service is registered 
>> > in
>> > the
>> > local system account and 'Everyone' has launch and access permissions.
>> > What
>> > am I missing?
>> >
>>
>>
>> 


Relevant Pages

  • Re: adding event sink functionality to a COM client not set up as a server
    ... public ISink ... Microsoft MVP, MCSD ... client program, ... IDL file that defines the interface.) ...
    (microsoft.public.vc.atl)
  • Re: creating an ATL COM service
    ... cocreateinstance() was successful. ... COM service and implemented an interface with an addnumbersmethod. ... creating a client. ... the header file of the com dll and i also defined some GUID's. ...
    (microsoft.public.vc.atl)
  • Re: Good COM Interface Design
    ... Microsoft MVP, MCSD ... imagine that in release 1.0.0.0 you introduce interface A1, ... so you old client can still use A1 that they know about and your new ... relationship then inheritance maybe a good solution. ...
    (microsoft.public.vc.atl)
  • Re: Firing events from thread across proces
    ... Microsoft MVP, MCSD ... > This component gets created from the client(ServerComp).The client then ... > component that is required by the client is created and it's pointer is ... > Now to solve this problem, I passed the marshalled interface pointer ...
    (microsoft.public.vc.atl)
  • Re: idl question
    ... Microsoft MVP, MCSD ... > to various client interfaces between the two servers. ... > I can't get this to compile. ... > but would prefer to pass the interface I want to use. ...
    (microsoft.public.vc.atl)