Any method for accessing Windows COM methods using Java?

让人想犯罪 __ 提交于 2019-12-21 16:59:26

问题


I have an application which makes use of JNA to call functions from a hardware abstraction library in C++. One of the supported hardware devices requires Windows COM subsystem to be initialized (via CoInitialize or CoInitializeEx).

Does anybody know any Java library which can do the trick? I know I could wrap some Windows functions, but if I had something ready and tested, that would be better. I found one called JACOB but it is said that the documentation is not good and it's been a long time since they last updated it.

Thanks!


回答1:


We use Com4J (for external processes like Excel) and the SWT COM API (for embedded GUI components). Sometimes, we use Jacob, it depends on the control you want to control. Sometimes they don't implement the IDispatch interface correctly, and then only one of the Java Com APIs works.

We also had COM components that needed a VB6 wrapper DLL, which in turn can be called with Com4J, so prepare for some headaches!




回答2:


Have a look @ JCom (Java-COM Bridge)

Other implementation exist but I used this one and it worked for me..



来源:https://stackoverflow.com/questions/4947661/any-method-for-accessing-windows-com-methods-using-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!