控制台应用服务或 ATL 服务

发布于 2024-08-11 06:24:43 字数 112 浏览 2 评论 0原文

我需要创建一个服务。我知道您可以仅使用控制台应用程序来完成此操作,但也可以使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如果没结果 2024-08-18 06:24:43

该服务并不完全受益于 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 :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文