Using a combo server, how can I add event handlers for the TService object from which TROService derives?
I need to add handlers to the AfterInstall, AfterUninstall and other event handlers so I can log when the service is installed, uninstalled, started, stopped and so forth. In my own service applications this is no problem but I can’t see how I can add handlers to the TROService object.
for caught such events, you need to create own ROStartService method because service is installed and uninstalled in this method.
I can suggest to create own descendant from TROService, which will contain logging and use it in your replica of ROStartService.
Ok thanks. It seems it’s easy enough to add handlers for OnStart and OnStop after ROStartService has been called but, as you say, I can’t intercept the installation and uninstallation events unless I replace ROStartService.
Had a look at this but it seems I can’t easily replace ROStartService in my own unit due to the variables involved being in the implementation section of uROComboService and thus inaccessible by other units. Seems the only way would be to directly modify uROComboService which I don’t really want to do as it causes hassle when upgrading RO.
Could I make a suggestion that you implement some type of class factory & metaclass system which facilitates easy sub-classing of TROService? At present I can’t find any way of intercepting the installation and uninstallation of the service, which I want to do both for logging purposes and to configure registry settings for the event log message file.