.NET Assembly (DLL)

83 views
Skip to first unread message

Francois

unread,
Sep 30, 2011, 10:27:35 AM9/30/11
to Java Native Access
Hi guys, I'm trying to use JNA in order to invoke a method from a .NET
Assembly (which is COM-enabled). The method is quite simple, takes a
String as parameter and returns a String as well. But I can't get it
working.

Here is my Java code :
public class Test {
public interface EvalExpLibrary extends Library {
public String Evaluate(String expression);
}

public static void main(String[] args) {
EvalExpLibrary dll = (EvalExpLibrary) Native.loadLibrary("C:\
\ExpEval.dll", EvalExpLibrary.class);
String result = dll.Evaluate("@@$VER@@");

System.out.println("Version : " + result);
}
}

Here is the execution output :
Exception in thread "main" java.lang.UnsatisfiedLinkError: Error
looking up function 'Evaluate': La procédure spécifiée est
introuvable.

at com.sun.jna.Function.<init>(Function.java:179)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:344)
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:324)
at com.sun.jna.Library$Handler.invoke(Library.java:203)
at $Proxy0.Evaluate(Unknown Source)
at Test.main(Test.java:17)


Any thoughts?

Thanks,
Francois

Francois

unread,
Oct 3, 2011, 3:54:54 AM10/3/11
to Java Native Access
Hi, anybody can help me on this please?

Cheers,
Francois
Reply all
Reply to author
Forward
0 new messages