如何在本机C ++程序中托管WCF服务 [英] How to host a WCF service in native C++ program

查看:104
本文介绍了如何在本机C ++程序中托管WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在C#编程的Windows通信基础(WCF)服务。我需要将它托管在我的C ++ MFC本机应用程序(没有C + + / CLI)。我不知道该怎么做。客户端也是一个C#应用程序。

I have a Windows Communication Foundation (WCF) service programmed in C#. I need to host it inside my C++ MFC native application (no C++/CLI). I don't know how to do that. The client is also a C# application.

任何人都可以帮助我?

推荐答案

OK - 如果你想要一个WCF服务,我强烈建议你在.Net中实现服务并用IIS发布。

OK - If you want a WCF service, I'd strongly urge you to implement the service in .Net and publish it with IIS.

敦促您忘记MFC。

I'd urge you to forget about MFC. Especially if you're considering Windows Tablet 8. Or Apple iPad!

对于真正的便携式平板电脑客户端,我强烈建议您 HTML5,并查看像AppCelerator Titanium或PhoneGap之类的框架:

For truly portable tablet clients, I'd strongly urge you "think HTML5" and look at a framework like AppCelerator Titanium or PhoneGap:

http://phonegap.com/

,如果你想要WCF服务(或任何.Net功能)与C ++程序的内部通信,你有很多选择。包括Interop:声明外部引用并简单地对非托管(C ++)代码进行子程序调用:

Finally, if you want your WCF service (or any .Net functionality) to "communicate with the internals of your C++ program", you've got lots of choices. Including "Interop": declaring an external reference and simply making a subroutine call into your unmanaged (C++) code:

http://msdn.microsoft.com/en-us/library/aa645738%28v=vs.71%29 .aspx

IMHO ...

这篇关于如何在本机C ++程序中托管WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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