Any method for accessing Windows COM methods using

2019-04-09 01:16发布

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!

标签: java windows com
2条回答
劫难
2楼-- · 2019-04-09 01:40

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!

查看更多
何必那么认真
3楼-- · 2019-04-09 01:46

Have a look @ JCom (Java-COM Bridge)

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

查看更多
登录 后发表回答