开发者

c# app communicate with vb6 app

开发者 https://www.devze.com 2023-04-11 20:34 出处:网络
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 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 开发者_JAVA技巧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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号