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

[1324 byte] By [josemecha] at [2007-11-26 21:54:59]
# 1

Hi,

You should post your code in [ code ][ /code ] tags.

Your code seems fine.

Did you test iResult to check it is a good value for _WNSubscribe function ?

As I don't know about the erasures of your C functions, I can't help you more.

--Marc (http://jnative.sf.net)

mdentya at 2007-7-10 3:50:25 > top of Java-index,Java HotSpot Virtual Machine,Specifications...