Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. WinAPI Service StartServiceCtrlDispatcher gives Error-Code "1063"

WinAPI Service StartServiceCtrlDispatcher gives Error-Code "1063"

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpvisual-studiosysadmintutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Harry_D
    wrote on last edited by
    #1

    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

    _ B 2 Replies Last reply
    0
    • H Harry_D

      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

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      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

      H 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        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

        H Offline
        H Offline
        Harry_D
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • H Harry_D

          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

          B Offline
          B Offline
          BukeMan
          wrote on last edited by
          #4

          Hello! Did you manage to find a workaround for this issue? I have the same issue and I also found a plenty of other threads with the same issue. Too bad all of them do not have answer...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups