控制台应用服务或 ATL 服务
我需要创建一个服务。我知道您可以仅使用控制台应用程序来完成此操作,但也可以使用 ATL 来完成。ATL 服务与简单的控制台应用程序服务相比有哪些好处?我知道ATL是COM..但是COM与服务有什么好处..谢谢!
I need to create a service. I know that you can do it with just a console application but it can also be done with ATL.. What are the benefits of the ATL Service vs a simple console application service? I understand that ATL is COM.. but what are the benefits of COM with the service.. thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该服务并不完全受益于 COM,而是相反。
通过在服务中托管 COM 对象,您可以获得服务的所有系统功能(用户登录前启动、受控策略看门狗、身份配置等)。ATL
使您有机会在服务上下文中运行 COM 对象,与进程内 (DLL) 或常规进程外托管相反。 COM+ 是定制托管的另一种选择。
如果您的服务只是后台服务,添加 COM 支持可以为您提供简单的可编程性,但除此之外我看不到任何好处。
所以,我不确定这是否能回答你的问题......这个问题感觉很落后:)
The service doesn't exactly benefit from COM, but rather the other way around.
By hosting your COM objects in a service, you get all the system features of services (startup before users log on, controlled policies watchdog, configuration of identity, etc.)
ATL gives you the opportunity to run your COM objects in a service context, as opposed to in-process (DLL) or regular out-of-process hosting. COM+ is another alternative for customized hosting.
If your service is just a background service, adding COM support could give you simple programmability, but otherwise I don't see any benefits.
So, I'm not sure that answers your question... The question feels backward :)