c#应用与vb6应用通信 [英] c# app communicate with vb6 app

查看:383
本文介绍了c#应用与vb6应用通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个c#.net 4.0应用程序,我需要发送数据到VB6应用程序。
VB6可以通过DDE发送和回退数据,但我找不到任何工作和可理解的DDE协议为我的C#应用​​程序。我可以尝试和更改VB应用程序的通信协议。
对于合适的协议有什么建议吗?

I wrote a c#.net 4.0 application and I need to send data to a VB6 application. the VB6 can send and recive data via DDE, but I can't find any working and or understandable DDE protocol for my C# app. I can try and change the communication protocol of the VB app. Do you have any suggestions for suitable protocol?

我发现这个主题,我想我会选择TCP winsock协议,这是在两个工作区可用,但我找不到这样的多边形的任何工作代码示例使用Winsock。
我很高兴得到这样的例子。
谢谢!

I found this topic and I think I will choose the TCP winsock protocol, which is availible at the two workspaces, but I can't find any working code sample of such multilanguege use of Winsock. I'll be glad to get such example. Thanks!

推荐答案

如果你想坚持使用DDE,你可以看看这个项目: http://ndde.codeplex.com/
http://www.angelfire.com/biz/rhaminisys/ddeinfo.html 。我没有使用它们的经验,但他们的目的是解决这个问题。

If you want to stick with DDE you could check out this project: http://ndde.codeplex.com/ or http://www.angelfire.com/biz/rhaminisys/ddeinfo.html. I have no experience using them, but they aim to solve the problem.

但是,如果你有VB6应用程序的源代码,那么它可以更简单你要暴露一个COM接口。

However, if you have the source code for the VB6 application, then it may be much simpler for you to expose a COM interface.

您可以通过将项目从Standard EXE更改为ActiveX EXE并创建至少一个公开类来公开您的方法来实现。我这样做的所有我以前使用DDE和higly推荐它的VB6应用程序。它为客户端应用程序提供了更好的接口。

You can do so by changing the project from Standard EXE to ActiveX EXE and creating at least one public class exposing your methods. I did this for all my VB6 apps that previously used DDE and higly reccommend it. It gives the client application a better interface to work with.

这篇关于c#应用与vb6应用通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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