适用于 VB6 和 .net 应用程序的最佳 IPC [英] Best IPC for VB6 and .net application

查看:22
本文介绍了适用于 VB6 和 .net 应用程序的最佳 IPC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的应用程序(文档管理系统)中,我们应该收到屏幕更改通知(或通知其他程序屏幕更改),以便让两个应用程序查看相同的数据,一个是订单履行应用程序,另一个是原始传真的文档查看器.履行应用程序使用 vb6 编写,文档管理器使用 .net 3.5 (c#).它在终端服务器上运行,因此它也必须是会话感知的.可以先打开文档查看器或履行应用程序,并且可以在没有另一个的情况下使用两者.最好的 IPC 方法是什么?

In our application (a document management system) we are supposed to be notified of screen changes (or notify the other program of screen changes) in order to keep the two applications looking at the same data, one being the order fulfillment app, the other the document viewer of the original fax. The fulfillment app is written in vb6 and the document manager is in .net 3.5 (c#). It runs on a terminal server so it also has to be session aware. The document viewer or the fulfillment app may be open first and both can be used without the other. What would be the best method of IPC?

推荐答案

如果您希望能够在 Vista 或 Windows 7 上运行,最好的 IPC 形式将是 TCP(这在 VB6 中很容易使用Winsock 控件).

If you want to be able to run on Vista or Windows 7, the best form of IPC is going to be TCP (which is done very easily from VB6 with the Winsock control).

这样做的好处是两个应用程序可以通信,即使它们不是以同一用户身份运行,它们也可以通信(在 Vista+ 下使用 SendMessage 或命名管道无法做到这一点).您唯一需要记住的就是在防火墙中设置一条规则,这样它就不会被阻止.这可以在您的安装程序中完成:

The advantage of this is that two apps can communicate even if they aren't running as the same user, they can communicate (you can't do that with SendMessage or Named Pipes under Vista+). The only thing you have to remember to do, is set a rule in the firewall so it doesn't get blocked. This can be done in your installer with:

netsh.exe firewall set allowedprogram "{PROGRAM PATH}" "{PROGRAM NAME}" enable

这篇关于适用于 VB6 和 .net 应用程序的最佳 IPC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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