Windows系统服务创建步骤,常用类封装,废话不多说,直接上代码

 1 // ServceDemo.cpp : 定义控制台应用程序的入口点。
 2 //
 3 
 4 #include "stdafx.h"
 5 #include "WindwosService.h"
 6 
 7 unsigned __stdcall SvcRun (void *Params )
 8 {
 9     while(1)
10     {
11 
12         for (int i = 0;i < 100;i++)
13         {
14             printf("%d\n",i);
15         }
16 
17         ::Sleep(1*60*1000);
18     }
19     return 0;
20 }
21 
22 int _tmain(int argc, _TCHAR* argv[])
23 {
24 #ifdef WIN32
25     InitService(argc,argv);
26 #endif // WIN32
27 
28 #ifdef linux
29 
30 #endif // linux
31 
32     return 0;
33 }
main函数文件代码

相关文章:

  • 2021-10-19
  • 2021-10-23
  • 2021-10-29
  • 2022-12-23
  • 2022-02-05
  • 2021-07-06
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2021-06-12
  • 2021-05-22
  • 2021-11-30
  • 2021-08-28
  • 2022-01-17
  • 2021-12-05
相关资源
相似解决方案