title: JNI Pass By Reference, Is it Possible?
body: <p>I have a Java program that calls a C++ program to authenticate users. I would like the program to return either true or false, and if false, update a pointer to an error message variable that i then can grab from the Java program.</p>
  
  <p>Another explination:</p>
  
  <p>The native method would look something like this:</p>
  
  <p><code>public native String takeInfo(String nt_domain, String nt_id, String nt_idca, String nt_password, String &amp;error);</code></p>
  
  <p>I would call that method here:</p>
  
  <p><code>boolean canLogin = takeInfo(domain, userID, "", userPass, String &amp;error)</code></p>
  
  <p>Then in my C++ program I would check if the user is authenticated and store it in a boolean, then if false, get the error message and update &amp;error with it. Then return that boolean to my Java program where I could display the error or let the user through.</p>
  
  <p>Any ideas?</p>
  
  <p>Originally I had it so the program would return either "true" or the error message, as a jstring, but my boss would like it as described above.</p>