Explorar o código

优化:
首次安装服务时,需要单击运行SATService.exe,此时服务不存在,无须运行主程序主线程;

scbc.sat2 %!s(int64=5) %!d(string=hai) anos
pai
achega
25acb6c860
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      SATService/SATService/SATService.cpp

+ 2 - 1
SATService/SATService/SATService.cpp

@@ -136,13 +136,14 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
 
 		// 2.不存在,安装服务;
 		WindowsService::InitSvcVar();
+#if 0	// 若服务不存在,无须执行主程序;
 		WindowsService::SetCallBack(WorkStart, WorkEndof);
 		SERVICE_TABLE_ENTRY st[] =
 		{
 			{ WindowsService::g_szSvcName, (LPSERVICE_MAIN_FUNCTION)WindowsService::ServiceMain },
 			{ NULL, NULL }
 		};
-
+#endif 
 		WindowsService::SvcInstall();
 	}