开发者

Calling COM method in DLL using the JNI

开发者 https://www.devze.com 2023-02-24 08:28 出处:网络
I\'m trying to integrate with a third party DLL using the JNI. I\'ve written a test class to see if I can call a method in the 开发者_如何学GoDLL but I\'m getting an \"UnsatisfiedLinkError\" error.

I'm trying to integrate with a third party DLL using the JNI. I've written a test class to see if I can call a method in the 开发者_如何学GoDLL but I'm getting an "UnsatisfiedLinkError" error.

The class looks like the following:

public class MyTest {

    native String ConfigureRequest(String a, String b, String c, String d);

    static {
        System.loadLibrary("my_dll");
      }

    @Test
    public void quickTest(){

        String result = this.ConfigureRequest("1", "1", "1", "NoControlBar");

        System.out.println("Result: " + result );

    }

}

I have used The TypeLibrary Viewer to investigate the DLL and I can see that the method is there (although it says its in the package "EIAComInterface.TxnRequests" so I'm wondering do I need to specify the package somewhere on the method). I can also verify that the method parameters are correct.

Can anyone advise on this please?

Thanks a lot, Gearoid.


It looks as though Jacozoom could be a possible solution to the above problem. In my case, it turns out that I can use SOAP to query the webservice.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号