Erlang 与 COM 对象的交互

Erlang interactions with COM objects

有谁知道如何使用 Erlang 与 COM 对象交互?我发现彗星库允许它,但看起来这段代码不再存在于 OTP 包中。

我正在考虑用另一种语言(如 C++ 或 C#)编写代码并通过端口与 Erlang 通信,但不确定这种方法是否最方便。

是的,erl_com (comet) 是 not supported since R9B

Comet, COM client for Erlang (REMOVED)

The Comet application is removed from the product because we currently have no resources to maintain it. We plan to make it available on the Open Source site. It still works on Windows NT 4, but there are problems on Windows XP.

我们现在有 18.3(旧版本格式的 R18B03)。它使用的是 linked_in driver for communication. It is a quite efficient way to communicate with external code but dangerous.

Warning

A faulty linked-in driver causes the entire Erlang runtime system to leak memory, hang, or crash.

有关详细信息,请参阅 Interoperability Tutorial User's Guide。主要有四个选项:

  1. Ports - 通过 stdin/stdout.
  2. 进行通信的分叉进程
  3. Port Drivers(链接驱动程序)- 类似于 Ports 但在模拟器内存​​中 space。速度快,流量控制好但危险。
  4. C/Java Nodes - 用外语编写的服务器,其行为类似于 Erlang 集群中的节点。使用 Erlang 分发协议。
  5. NIFs - 与链接驱动程序相同的可靠性缺点,但更简单 API。
如果您担心可靠性,

端口和 C/Java 节点是首选方式。当性能最重要时,首选 NIF。链接驱动程序是遗留的,用于 NIF API 不够强大的特殊用途。

当然,您可以使用 Standard Protocols.

与服务器通信