June 22nd, 1999, 12:08 PM
I have created and installed a service. When I open the SCM the service is in the list. However when I start the service the SCM posts the following error message
"The service process could not connect to the service controller". This would lead me to think the service was not installed, however I am able to get a handle to
the service by calling the OpenService() API, I am also able to unistall the service.
The above error message is being fed from the StartServiceCtrlDispatcher( ) function.
Here is the CreateService() call I am using to create my service...
if(h_SCM)
SC_HANDLE h_newService= CreateService(h_SCM,
g_ServiceName,
g_DisplayName,
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_DEMAND_START ,
SERVICE_ERROR_NORMAL,
_T("L:\\client\\ctransui\\cjhserv\\debug\\cjhserv.exe"),
NULL,
NULL,
NULL,
NULL,
NULL);
and here is the code I am using to start the dispatcher...
SERVICE_TABLE_ENTRY ServiceTable[] = {
{(LPTSTR) g_ServiceName, ServiceMain },
{NULL, NULL} };
if(!::StartServiceCtrlDispatcher(ServiceTable))
CServerObj::PrintError();
if anyone can offer me any insight into this I would be very grateful...Thanks you.
"The service process could not connect to the service controller". This would lead me to think the service was not installed, however I am able to get a handle to
the service by calling the OpenService() API, I am also able to unistall the service.
The above error message is being fed from the StartServiceCtrlDispatcher( ) function.
Here is the CreateService() call I am using to create my service...
if(h_SCM)
SC_HANDLE h_newService= CreateService(h_SCM,
g_ServiceName,
g_DisplayName,
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_DEMAND_START ,
SERVICE_ERROR_NORMAL,
_T("L:\\client\\ctransui\\cjhserv\\debug\\cjhserv.exe"),
NULL,
NULL,
NULL,
NULL,
NULL);
and here is the code I am using to start the dispatcher...
SERVICE_TABLE_ENTRY ServiceTable[] = {
{(LPTSTR) g_ServiceName, ServiceMain },
{NULL, NULL} };
if(!::StartServiceCtrlDispatcher(ServiceTable))
CServerObj::PrintError();
if anyone can offer me any insight into this I would be very grateful...Thanks you.