java-COM interop: Implement COM interface in Java(java-COM interop:用Java实现COM接口)
问题描述
如何在 java 中实现 vtable COM 接口?
How can I implement a vtable COM interface in java?
在过去,我会使用 Microsft JVM,它内置了 java-COM 互操作.现代 JRE 的等价物是什么?
In the old days, I'd use the Microsft JVM, which had built in java-COM interop. What's the equivalent for a modern JRE?
回答一个类似的SO问题雅各布.我看过 JACOB,但它基于 IDispatch,旨在控制自动化服务器.我需要的 COM 接口是自定义 vtable(扩展 IUnknown),例如IPersistStream、IOleWindow、IContextMenu 等
Answers to a similar SO question proposed JACOB. I've looked at JACOB, but that is based on IDispatch, and is aimed at controlling Automation serers. The COM interfaces I need are custom vtable (extend IUnknown), e.g. IPersistStream, IOleWindow, IContextMenu etc.
对于我的用例,我可以在 JNI 中实现所有 COM 细节,并让 JNI 层调用 java 中的相应接口.但我希望有一个不那么痛苦的解决方案.
For my use case, I could implement all the COM specifics in JNI, and have the JNI layer call corresponding interfaces in java. But I'm hoping for a less painful solution.
这是一个开源项目,所以首选开源替代品.
It's for an open source project, so open source alternatives are preferred.
Com4j 看起来很有希望.查看可用的文档,它似乎不支持注册 IClassFactory,因此 COM 对象(在 java 中)可以由非 java 客户端实例化.
Com4j looks promising. Looking through the available docs, it doesn't seem to support registering a IClassFactory so the COM object (in java) can be instantiated by non-java clients.
推荐答案
Com4J可能是你需要的.从主页:
Com4J may be what you need. From the homepage:
直接绑定到 vtable 接口(不是 IDispatch)用于改进性能和更广泛的支持更多 COM 接口.
Binds directly to the vtable interface (not IDispatch) for improved performance and broader support for more COM interfaces.
这篇关于java-COM interop:用Java实现COM接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:java-COM interop:用Java实现COM接口
基础教程推荐
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 降序排序:Java Map 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01