Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Install a service with SERVICE_AUTO_START using CAtlServiceModuleT

124 views
Skip to first unread message

Jean-Francois

unread,
Mar 24, 2005, 10:07:07 AM3/24/05
to
I'm implementing a Windows Service using ATL7 and CAtlServiceModuleT template
(generated with the wizard).

CAtlServiceModuleT implementation in atlbase.h Install() method hardcode the
dwStartType = SERVICE_DEMAND_START when calling CreateService.

I'd like to change this behavior to make it SERVICE_AUTO_START but I cannot
override the Install() method in the child class since the method is not
virtual. (Most of them are not actually).

How can I change the start type of the service when it's installed without
having to rewrite my own CAtlServiceModuleT class?

Thanks for your help

Kim Gräsman

unread,
Mar 28, 2005, 4:42:44 AM3/28/05
to
Hi Jean-Francois,

> I'd like to change this behavior to make it SERVICE_AUTO_START but I cannot
> override the Install() method in the child class since the method is not
> virtual. (Most of them are not actually).

I suppose what you could do is override RegisterAppId, which is only called through a downcasted pointer to your derived class.

Copy the RegisterAppId and Install method implementations down to your derived class, and modify at will.

I agree it's not exactly ideal...

--
Best regards,
Kim Gräsman

Jean-Francois

unread,
Mar 29, 2005, 4:01:01 PM3/29/05
to
Hi Kim,

As you said, it's not an ideal solution but I only need to implement
(copy/paste) 2 methods (RegisterAppID and Install) instead of the whole
CAtlServiceModuleT so that's good enough for me.

Thanks for your anwser.
Jean-Francois

0 new messages