Check out http://www.javonet.com . With a single jar file, you can load this DLL and call it like this:
Javonet.AddReference("your-lib.dll"); int result = Javonet.getType("ReturnINT").Invoke("RetornaInteiro");
Javonet will automatically load your library in the .NET process and give you access to any classes and types contained in it. Then you can get your type and call the static method. Method results and arguments are automatically translated between the JAVA and .NET types. You can pass an example string or bool arguments like
Boolean arg1 = true; String arg2 = "test"; Javonet.getType("ReturnINT").Invoke("MethodWithArguments",arg1,arg2);
And they will be translated automatically.
In addition, you can also create an instance of your type, subscribe to events, set / receive properties and fields, handle exceptions, or even pass arguments of type value. Check the docs for more details:
http://www.javonet.com/quick-start-guide/
PS: I am a member of the Javonet team. So feel free to ask me any detailed questions regarding native integration and our product.
source share