c# app communicate with vb6 app

白昼怎懂夜的黑 提交于 2019-12-12 02:13:27

问题


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?

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!


回答1:


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.

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

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.



来源:https://stackoverflow.com/questions/7716985/c-sharp-app-communicate-with-vb6-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!