I can't open the OpenSCManager Function in C++ & Debug. The error-code is always 5. :confused: It works, when i don't use Debug with Admin-Rights only. With VS 2008 it works. What can i do ? :confused:
Harry_D
Posts
-
VS 2010 C++ Debug -
WinAPI Service StartServiceCtrlDispatcher gives Error-Code "1063"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
-
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