℃之间传递数据++(MFC)应用程序和C# [英] Passing data between C++ (MFC) app and C#

查看:181
本文介绍了℃之间传递数据++(MFC)应用程序和C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个接​​近它的生命结束在C单片MFC GUI应用程序++。我们计划在C#来构建新的功能,并通过各应用之间的数据

We have a monolithic MFC GUI app that is nearing the end of it's life in C++. We are planning to build new functionality in C# and pass data between each app.

问题是:什么是C ++和C#之间传递数据的最佳方法?

Question is: What is the best approach for passing data between C++ and C#?

注:

两端都将有一个GUI前端,将可能只需要通过类似编号的简单的数据,并可能有一个机制,其中它表明其他应用程序什么进程/功能才可以使用。

例如其中一个应用将是一个CRM系统在C#,当在网格的行是双击时将通过说CustomerID和消息以在MFC应用程序的顾客表格中打开该客户的

Notes:
Both ends will have a GUI front end and will probably only need to pass simple data like Id's and possibly have a mechanism where it indicates to the other app what process/functionality to use.
Eg One of the applications will be a CRM system in C# that when a row in a grid is double clicked would pass say the customerId and a message to open that customer in the Customer Form of the MFC app.

我做的一点点研究,选项似乎是Windows消息,内存映射,命名管道或类似Windows套接字。在这个阶段,我们倾向于命名管道,但真的很感激,其他方面的建议或提示或其他民族的经验。

I have done a little bit of research, the options seem to be Windows Messaging, Memory Mapping, Named Pipes or something like Windows Sockets. At this stage we are leaning towards Named Pipes, but would really appreciate other advice or tips or other peoples experiences.

推荐答案

我个人因为它们很容易从C ++侧和.NET侧也System.IO.Pipes用倒是会考虑使用类似的命名管道。

Personally I'd be thinking of using something like named pipes as they are easy to use from the C++ side and the System.IO.Pipes on the .NET side also.

据也将是可能的阻力最小的路径,如果你打算随着时间的推移,以取代应用程序的其他非.NET位。

It would also be the path of probably least resistance if you're planning to replace the other non .NET bits of the app over time.

这篇关于℃之间传递数据++(MFC)应用程序和C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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