Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #18998

JNI return jobjectArray

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.szaf.org!news.gnuher.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail
From Philipp Kraus <philipp.kraus@flashpixx.de>
Newsgroups comp.lang.java.programmer
Subject JNI return jobjectArray
Date Sun, 30 Sep 2012 22:23:48 +0200
Organization 1&1 Internet AG
Lines 30
Message-ID <k4a9gd$usp$1@online.de> (permalink)
NNTP-Posting-Host p4fc60383.dip0.t-ipconnect.de
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding 8bit
X-Trace online.de 1349036365 31641 79.198.3.131 (30 Sep 2012 20:19:25 GMT)
X-Complaints-To abuse@einsundeins.com
NNTP-Posting-Date Sun, 30 Sep 2012 20:19:25 +0000 (UTC)
User-Agent Unison/2.1.9
Xref csiph.com comp.lang.java.programmer:18998

Show key headers only | View raw


Hello,

I hope this question is not OT.

I create a JNI call for this Java method

class myclass {

    void native mymethod( Double[] x )
}

so the parameter x should be a call-by-reference, I would set x in the 
native JNI function:

void mymethod( JNIEnv *jenv, jclass jcls, jobjectArray& jarg )
{
   // do something
   jobjectArray t = .....

   jarg = t;
}

How can I set the jobjectArray& back, so the data is return in the parameter x?
IMHO I need jenv->NewGlobalRef, os this the correct use jarg = 
(jobjectArray)jenv->NewGlobalRef( (jobject*) &t ) ?

Thanks

Phil

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

JNI return jobjectArray Philipp Kraus <philipp.kraus@flashpixx.de> - 2012-09-30 22:23 +0200
  Re: JNI return jobjectArray markspace <-@.> - 2012-09-30 14:56 -0700
    Re: JNI return jobjectArray Philipp Kraus <philipp.kraus@flashpixx.de> - 2012-10-01 00:23 +0200
      Re: JNI return jobjectArray markspace <-@.> - 2012-09-30 19:21 -0700
        Re: JNI return jobjectArray Lew <lewbloch@gmail.com> - 2012-09-30 21:14 -0700
          Re: JNI return jobjectArray markspace <-@.> - 2012-10-01 08:32 -0700
      Re: JNI return jobjectArray "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2012-10-01 09:39 +0100
  Re: JNI return jobjectArray Roedy Green <see_website@mindprod.com.invalid> - 2012-10-01 10:21 -0700
  Re: JNI return jobjectArray Steven Simpson <ss@domain.invalid> - 2012-10-01 23:46 +0100

csiph-web