vb.net - How to use .Net dll in Java -
i have dll created in vb.net. how can use functions in java.
i found jni while searching on google , not getting it. there simple documentation example.
i recommend java native access (jna) easier using jni. lets have dll functions,
- create java interface has same method signatures functions in dll.
for example
public interface nativeexample{ public int method1(string param1); public boolean mehthod2(); }
now following way load dll (assuming name nativelib.dll)
nativeexample nativeexample= (nativeexample) native.loadlibrary("nativelib", nativeexample.class);
once have this, can call method dll via java methods.
`nativeexample.method("test");` `nativeexample.method2();`
for mappings of datatypes between java , native, please refer the link above.
here one more example.
Comments
Post a Comment