我们可以创建一个C ++程序的.exe文件的窗口服务 [英] Can we create a window service of a C++ program's .exe file
问题描述
Hello Coders,
我用c ++编写了一个程序。它检索在Windows中运行的进程。我正在创建这些过程的数据库。为此我需要在后台运行该过程,所以我创建了它的服务使用
Sc create ...... start = auto。
但每次都会出错
Windows无法在本地计算机上启动服务名称服务。
错误1053:服务没有及时响应启动或控制请求。
感谢您的期待
我的尝试:
我没有使用任何类型的服务在我的代码中创建编码。我通过cmd创建了服务。
Hello Coders,
I have written a program in c++. It retrieves the processes running in windows. I am creating a data base of these processes. For this I need to run that process in background, so I created its service using
Sc create......start= auto.
But It is giving an error every time
Windows can not start the "service name" service on Local Computer.
error 1053: The service did not respond to the start or control request in a timely fashion.
Thank You in anticipation
What I have tried:
I haven't used any kind of service creating coding in my code. I created service through cmd.
推荐答案
您必须创建一个提供必要功能的服务应用程序(主入口点,服务入口点和服务控制处理程序)。一些有用的链接:
C ++中的简单Windows服务 [ ^ ]
基本的Windows服务在C ++(CppWindowsService)C ++ for Visual Studio 2008中的示例 [ ^ ]
服务计划(Windows) [ ^ ]
You must create a service application that provides the necessary functions (main entry point, service entry point, and service control handler).
Some useful links:
Simple Windows Service in C++[^]
A basic Windows service in C++ (CppWindowsService) sample in C++ for Visual Studio 2008[^]
Service Programs (Windows)[^]
你在寻找像< a href =https://support.microsoft.com/en-us/kb/152460> SRVANY.EXE [ ^ ]?
这篇关于我们可以创建一个C ++程序的.exe文件的窗口服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!