JNative 2 function calls is not working
Hi,
I am trying to access a DLL file using JNative and i am able to call a method sucessfully, but when I try to call another method by same way it does not. Can i call 2 mehtods by creating instance of JNative? if I am accessing the methods in wrong way please correct me? Here is the code, which I tried.
public class Test {
public static void main(String[] args) throws NativeException, InterruptedException, IllegalAccessException {
for(String s : JNative.getDLLFileExports("D:\\Venkat\\dlls\\Ldcnlib.dll")) {
System.err.println("--> " +s);
}
System.load("D:\\WNApi.dll");
JNative LdcnInit = new JNative("WNApi.dll", "_WNOpen");
LdcnInit.setRetVal(Type.INT);
LdcnInit.setParameter(0, "admin");
LdcnInit.setParameter(1, "admin");
LdcnInit.invoke();
int iResult = LdcnInit.getRetValAsInt();
System.err.println("Where open returned "+iResult);
JNative LdcnInit1 = new JNative("WNApi.dll", "_WNSubscribe");
LdcnInit1.setRetVal(Type.INT);
LdcnInit1.setParameter(0, iResult);
LdcnInit1.setParameter(1, "query");
LdcnInit1.invoke();
System.err.println("Wherenet subscribe returned "+LdcnInit1.getRetValAsInt());
}
}
Thanks in advance.
Regards,
Jose

