J
Jianwei Sun
Hi, all,
I have a question, and I hope to get some hints here..
I created a really simple service just to check why the service manager
doesn't start my service the second time if the first time failed..
I created an atl service through the wizard, and the only thing I do is
override the PreMessageLoop()...
HRESULT CAutoStartServiceModule:reMessageLoop(int nShowCmd)
{
HRESULT hr = CAtlServiceModuleT<CAutoStartServiceModule,
IDS_SERVICENAME>:reMessageLoop(nShowCmd);
if(FAILED(hr)) return hr;
//return a false here..
//log event here..
LogEvent(_T("Failed to start the service, should retry ...."));
return E_ABORT;
}
And in the service control panel, i set "Recovery options" as
First Failure: Restart the service..
Second Failure: Restart the service..
Subsequent Failure: Restart the service..
But the service was not restarted ...
I wonder maybe I miss something to report the right information back to
the service control manager..
Thanks for any help..
J.W.
I have a question, and I hope to get some hints here..
I created a really simple service just to check why the service manager
doesn't start my service the second time if the first time failed..
I created an atl service through the wizard, and the only thing I do is
override the PreMessageLoop()...
HRESULT CAutoStartServiceModule:reMessageLoop(int nShowCmd)
{
HRESULT hr = CAtlServiceModuleT<CAutoStartServiceModule,
IDS_SERVICENAME>:reMessageLoop(nShowCmd);
if(FAILED(hr)) return hr;
//return a false here..
//log event here..
LogEvent(_T("Failed to start the service, should retry ...."));
return E_ABORT;
}
And in the service control panel, i set "Recovery options" as
First Failure: Restart the service..
Second Failure: Restart the service..
Subsequent Failure: Restart the service..
But the service was not restarted ...
I wonder maybe I miss something to report the right information back to
the service control manager..
Thanks for any help..
J.W.