parameters - Passing pointer from java to native -


I am creating an interface for a DLL library, so I can use it with Java, To modify the value of your original function is required. As the parameter was passed from the context. The actual function in my Java method should be the exact parameters shown below as MPUSBWrite.

Example of a code that does not really work: MPUSBWrite refers to its fourth parameter as a reference and modify the value of the iTunes. I always get 0 when I have passed the pylon.

JAVA:

  public stable country boolean type (long handle, byte [] pidata, int dwLen, long pill, int dwMilliseconds);  

Native C ++:

  JNIEXPORT jboolean JNICALL Java_jPicUsb_iface_Write (JNIEnv * env, jclass jc, jlong ​​handle, jbyteArray pdata, Jint dwLen, pLength jlong, jint dwMilliseconds) {JniByteArray b (env, pData); DWORD res = MPUSBWrite (Handle) handles, B.A.T.Bets (), DSLLN, (PDWODS) PLANNMENT, DVMISConds); If (res) {back JNI_TRUE; } And {JNI_FALSE; }}  

Is there a way to modify the value of the pLength variable by my C ++ code reference?

no.

Your best option is, if you need to do this truly, as long as you define your fourth parameter, and your JNI code is to keep the table updated.

In fact, the reason for considering your best option is that you will not be able to return to the system for long periods of time.


Comments