WinAPI Service StartServiceCtrlDispatcher gives Error-Code "1063"
-
Hello, my Name is Harry Diel and I’m a Software-Engineer (Development) here in Germany. A couple of years ago (2000-2005) I developed for a Medical-Assosiation under Windows XP and Server 2003 with MFC und Visual C 6.0 a LAN-Manager System with some RPC-programs, which where running as services on several clients, in a large System-LAN environment with more than 1500 installed workstations (NT/XP), Printern and over 200 Servers with Windows 2003 / NT. everything was OK, until now the first Windows Vista will be used. The Time has come to upgrade to Windows Vista !!!! Now I updated my C-Programs to Visual C++ 9.0 and VS 2008. The functionalities of the program were still the same, nothing changed. But now I get from the StartServiceCtrlDispatcher Function always the Error-Code “1063” = ERROR_FAILED_SERVICE_CONTROLLER_CONNECT. (Only when the service starts on Windows Vista). I need help, what can I do. I tried everything, but nothing works and helps realy. Enclosed you will find a piece of my Program-Code of the C++ program, when the service should start working. But it stops!!!! Maybe you can send me an example for Windows Vista how it would work. I am waiting for an answer. Thank you. regards harry Diel, 47475 Kamp-Lintfort, Germany E-Mail: harry.diel@t-online.de 1 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 int Win_RemComServiceMain (void) 3 { /////////////////////////////////////////////////////////////////////////////// 4 sprintf (szOpenFName,"%s","C:\\Temp\\RemComLogDatei.log"); 5 hOpenF = CreateFile (szOpenFName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ, 6 NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 7 8 if (hOpenF == (HANDLE)ERROR) 9 { hOpenF = NULL; 10 } 11 /////////////////////////////////////////////////////////////////////////////// 12 _GetDateAndTime(); 13 sprintf(sWrkBuff,"%.6s | %s\tWin_RemComServiceMain\t: LogFile gestartet.%s",ActDatum, sCurrTime, EOR); 14 WriteErrorText_2 (sWrkBuff); 15 /////////////////////////////////////////////////////////////////////////////// 16 // Register the service control handler 17 g_hstatus = RegisterServiceCtrlHandler(REMC_SERVICENAME, ServiceCtrl); 18 if (g_hstatus == 0) 19 return FALSE; 20 21
-
Hello, my Name is Harry Diel and I’m a Software-Engineer (Development) here in Germany. A couple of years ago (2000-2005) I developed for a Medical-Assosiation under Windows XP and Server 2003 with MFC und Visual C 6.0 a LAN-Manager System with some RPC-programs, which where running as services on several clients, in a large System-LAN environment with more than 1500 installed workstations (NT/XP), Printern and over 200 Servers with Windows 2003 / NT. everything was OK, until now the first Windows Vista will be used. The Time has come to upgrade to Windows Vista !!!! Now I updated my C-Programs to Visual C++ 9.0 and VS 2008. The functionalities of the program were still the same, nothing changed. But now I get from the StartServiceCtrlDispatcher Function always the Error-Code “1063” = ERROR_FAILED_SERVICE_CONTROLLER_CONNECT. (Only when the service starts on Windows Vista). I need help, what can I do. I tried everything, but nothing works and helps realy. Enclosed you will find a piece of my Program-Code of the C++ program, when the service should start working. But it stops!!!! Maybe you can send me an example for Windows Vista how it would work. I am waiting for an answer. Thank you. regards harry Diel, 47475 Kamp-Lintfort, Germany E-Mail: harry.diel@t-online.de 1 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 int Win_RemComServiceMain (void) 3 { /////////////////////////////////////////////////////////////////////////////// 4 sprintf (szOpenFName,"%s","C:\\Temp\\RemComLogDatei.log"); 5 hOpenF = CreateFile (szOpenFName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ, 6 NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 7 8 if (hOpenF == (HANDLE)ERROR) 9 { hOpenF = NULL; 10 } 11 /////////////////////////////////////////////////////////////////////////////// 12 _GetDateAndTime(); 13 sprintf(sWrkBuff,"%.6s | %s\tWin_RemComServiceMain\t: LogFile gestartet.%s",ActDatum, sCurrTime, EOR); 14 WriteErrorText_2 (sWrkBuff); 15 /////////////////////////////////////////////////////////////////////////////// 16 // Register the service control handler 17 g_hstatus = RegisterServiceCtrlHandler(REMC_SERVICENAME, ServiceCtrl); 18 if (g_hstatus == 0) 19 return FALSE; 20 21
what privileges do you run the application with.... You should be an Admin...Vista has some issues that are to be dealt with regarding the admin privileges and running applications under it Did you try running the service when you are logged in as a local admin? ****************Also check the firewall..... on the Vista Machine
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
modified on Tuesday, February 10, 2009 6:59 AM
-
what privileges do you run the application with.... You should be an Admin...Vista has some issues that are to be dealt with regarding the admin privileges and running applications under it Did you try running the service when you are logged in as a local admin? ****************Also check the firewall..... on the Vista Machine
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
modified on Tuesday, February 10, 2009 6:59 AM
Hello, thank you for your E-Mail. But I checked everything. My account has all administrator-rights. When the service starts, it starts under the system-account and this is always an admin. I checked the firewall and the program is already configured, to go thru. I think, there's some mistake in the Vista System-Control-Manager. It works correctly under XP and NT and 2003. Thank you. regards Harry Diel
-
Hello, my Name is Harry Diel and I’m a Software-Engineer (Development) here in Germany. A couple of years ago (2000-2005) I developed for a Medical-Assosiation under Windows XP and Server 2003 with MFC und Visual C 6.0 a LAN-Manager System with some RPC-programs, which where running as services on several clients, in a large System-LAN environment with more than 1500 installed workstations (NT/XP), Printern and over 200 Servers with Windows 2003 / NT. everything was OK, until now the first Windows Vista will be used. The Time has come to upgrade to Windows Vista !!!! Now I updated my C-Programs to Visual C++ 9.0 and VS 2008. The functionalities of the program were still the same, nothing changed. But now I get from the StartServiceCtrlDispatcher Function always the Error-Code “1063” = ERROR_FAILED_SERVICE_CONTROLLER_CONNECT. (Only when the service starts on Windows Vista). I need help, what can I do. I tried everything, but nothing works and helps realy. Enclosed you will find a piece of my Program-Code of the C++ program, when the service should start working. But it stops!!!! Maybe you can send me an example for Windows Vista how it would work. I am waiting for an answer. Thank you. regards harry Diel, 47475 Kamp-Lintfort, Germany E-Mail: harry.diel@t-online.de 1 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2 int Win_RemComServiceMain (void) 3 { /////////////////////////////////////////////////////////////////////////////// 4 sprintf (szOpenFName,"%s","C:\\Temp\\RemComLogDatei.log"); 5 hOpenF = CreateFile (szOpenFName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ, 6 NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); 7 8 if (hOpenF == (HANDLE)ERROR) 9 { hOpenF = NULL; 10 } 11 /////////////////////////////////////////////////////////////////////////////// 12 _GetDateAndTime(); 13 sprintf(sWrkBuff,"%.6s | %s\tWin_RemComServiceMain\t: LogFile gestartet.%s",ActDatum, sCurrTime, EOR); 14 WriteErrorText_2 (sWrkBuff); 15 /////////////////////////////////////////////////////////////////////////////// 16 // Register the service control handler 17 g_hstatus = RegisterServiceCtrlHandler(REMC_SERVICENAME, ServiceCtrl); 18 if (g_hstatus == 0) 19 return FALSE; 20 21