Hi everyone,
Currently I am working on java project which uses methods and classes present inside a DLL. Suppose I have such a method inside the DLL(named MyDLL.dll):
Method inside my DLL codeextern "C" __declspec(dllexport) int myMethod();
corresponding JNA implementationimport com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.Platform; /** Simple example of native library declaration and usage. */ public class HelloWorld { public interface CLibrary extends Library { CLibrary INSTANCE = (CLibrary) Native.loadLibrary("MyDLL", CLibrary.class); int myMethod(); } public static void main(String[] args) { String libPath = "path to MyDLL.dll"; System.setProperty("jna.library.path", libPath); int RetVar = CLibrary.INSTANCE.myMethod(); } ////main function ends } ////class ends
So, my doubt is that like the function present inside the DLL, I have also got a class inside the DLL which needs to be exported:
Class inside my DLL codeextern "C" __declspec(dllexport) Class myClass { //////code inside class };
So, now the question is how I am gonna use this native class inside my java code like i did for the native method?
Thanking in advance,
With regards,
Satya Prakash.