vs 2010中如何使用ATL创建服务应用程序 [英] how to create a service application with ATL in vs 2010

查看:109
本文介绍了vs 2010中如何使用ATL创建服务应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在vs2010中使用ATL创建服务应用程序,我使用vs2010的向导来构建ATL Service应用程序.编译成功.但无法运行,服务管理器表示错误号为1053;我用vs2005像vs2010一样做,那样就可以了.

帮忙,这个问题折磨了我几个星期.

I want to create a service application with ATL in vs2010, I user vs2010''s wizard to built a ATL Service application. compile was successful. but can not run, Service manager said the error number is 1053; I use vs2005 do it as vs2010 did, that OK.

Help, this problem tortured me couple weeks.

推荐答案

问题的根本原因是ServiceBase类直接从在中定义的Service命令处理程序调用OnStop方法. Advapi32.dll文件的ScDispatcherLoop. 30秒后,如果ScDispatcherLoop线程尚未准备好从服务控制管理器接收新的服务命令,则Windows Service Controller会将服务标记为超时".因此,您会收到此错误消息.

参考: http://support.microsoft.com/kb/839174 [
Root cause for the problem is that the ServiceBase class calls the OnStop method directly from the Service command handler that is defined in the ScDispatcherLoop of the Advapi32.dll file. After 30 seconds, if the ScDispatcherLoop thread is not ready to receive a new service command from the service control manager, Windows Service Controller marks the service as "time out." Therefore, you receive this error message.

Ref: http://support.microsoft.com/kb/839174[^]


这篇关于vs 2010中如何使用ATL创建服务应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆