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
> 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
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