Article View: borland.public.jbuilder.java.language
Article #14495Re: Q: Returning null from JNI method?
From: Kobus du Toit
Date: Fri, 27 Aug 1999 00:00
Date: Fri, 27 Aug 1999 00:00
27 lines
1445 bytes
1445 bytes
If you can't get a better answer, why don't you just return a specific string and if you java code sees that string it puts null into the variable. Kobus Gabriel Lima wrote: > Hi. > I must implement a native method that returns a Java string. So far so > good, > I can create the Java string from a const char * invoking > (*env)->NewStringUTF(env, const char *). > My problem is another. Sometimes, instead of a String, the method must > return > a null value. But, as the method is implemented natively, I donοΏ½t know > how to access the 'Java null' value/datatype/object/whatever. > > I searched in jni.h for 'null' and found nothing, and the Java Tutorial > does not > mention this. > > If someone knows how to return a 'Java null' from a Native JNI method, > please > let me know. Thanks in advance > > Gabriel
Technical Details
Message-ID:
<37C66E8E.1A217CF1@iname.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37C58C9D.62A27FEC@enea.se>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,a44fb18b0c4ec7a2 X-Google-Attributes: gidf74b3,public From: Kobus du Toit <battlezone@iname.com> Subject: Re: Q: Returning null from JNI method? Date: 1999/08/27 Message-ID: <37C66E8E.1A217CF1@iname.com> X-Deja-AN: 517747987 Content-Transfer-Encoding: 8bit References: <37C58C9D.62A27FEC@enea.se> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: battlezone@iname.com Newsgroups: borland.public.jbuilder.java.language