且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Visual Studio 2010 中创建 C++ Windows 服务并与之通信?

更新时间:2022-03-01 01:53:27

不知道为什么,模板真的没了.

I don't know why, but the template is really gone.

对于您的应用程序和服务 WCF 之间的通信将是一个选项.WCF 的优点之一是,您可以轻松切换传输层(HTTP、TCP、共享内存)

For communicating between your application and the service WCF would be an option. One advantage of WCF is, that you can easily switch the transport layer (HTTP, TCP, Shared Memory)

查看此 MSDN 页面.它准确描述了您要实现的目标:在 Windows 服务中托管 WCF 服务.它甚至在最后包含一个简单的 Windows 服务实现.不幸的是没有 C++ 而是 C#.

Have a look at this MSDN page. It describes exactly what you are trying to achieve: Host a WCF Service in a Windows Service. It even contains a simple Windows Service implementation at the end. Unfortunately no C++ but C#.