从 Linux 使用 Windows DLL [英] Using Windows DLL from Linux

查看:51
本文介绍了从 Linux 使用 Windows DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要与 3rd 方应用程序接口,但该应用程序背后的公司没有公开消息协议,仅提供 Windows DLL 接口.

We need to interface to 3rd party app, but company behind the app doesn't disclose message protocol and provides only Windows DLL to interface to.

我们的应用程序是基于 Linux 的,所以我无法直接与 DLL 通信.我找不到任何现有的解决方案,所以我正在考虑在 Linux 和 Windows 之间编写基于套接字的桥接,但我确信这不是一个独特的问题,之前应该有人做过.

Our application is Linux-based so I cannot directly communicate with DLL. I couldn't find any existing solution so I'm considering writing socket-based bridge between Linux and Windows, however I'm sure it is not such a unique problem and somebody should have done it before.

您是否知道任何允许从 Linux 上的 C 应用程序调用 Windows DDL 函数的解决方案?它可以使用 Wine 或单独的 Windows PC - 没关系.

Are you aware of any solution that allows to call Windows DDL functions from C app on Linux? It can use Wine or separate Windows PC - doesn't matter.

非常感谢.

推荐答案

任何解决方案都需要在类 Windows"环境中运行的 DLL 与您的linux应用程序.

Any solution is going to need a TCP/IP-based "remoting" layer between the DLL which is running in a "windows-like" environment, and your linux app.

您需要编写一个简单的 PC 应用程序来公开 DLL 函数,可以使用自制协议,也可以使用 XML-RPC、SOAP 或 JSON 协议.RemObjects SDK 可能对您有所帮助 - 但可能有点矫枉过正.

You'll need to write a simple PC app to expose the DLL functions, either using a homebrew protocol, or maybe XML-RPC, SOAP or JSON protocols. The RemObjects SDK might help you - but could be overkill.

我会坚持使用真实"或虚拟化的 PC.如果您使用 Wine,DLL 开发人员不太可能提供任何支持.

I'd stick with a 'real' or virtualized PC. If you use Wine, the DLL developers are unlikely to offer any support.

MONO 也不太可能有任何帮助,因为您的 DLL 可能不是 .NET 程序集.

MONO is also unlikely to be any help, because your DLL is probably NOT a .NET assembly.

这篇关于从 Linux 使用 Windows DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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