[1507] in java-interest

home help back first fref pref prev next nref lref last post

Re: java-interest-digest V1 #150

daemon@ATHENA.MIT.EDU (Jeff White)
Wed Sep 6 15:11:02 1995

From: Jeff White <jsw@cs.brown.edu>
Date: Wed, 6 Sep 1995 12:32:10 -0400
To: java-interest@java.sun.com, ibalkhi@dnt.dialog.com
In-Reply-To: <199509052357.QAA04731@webrunner.neato.org>
Reply-To: jsw@cs.brown.edu


>>>>> "Imran" == owner-java-interest-digest  <owner-java-interest-digest@java.sun.com> writes:

    Imran> // start native function

    Imran> struct Hson *parent_mySon(struct Hparent *obj, struct Hson
    Imran> *SonObject){
	
    Imran> 	ClassClass *sonClass = FindClass (0,"son",TRUE);

I think it's a good idea to test the return value of this.
   if(!sonClass) exit(1);

    Imran> 	Hjava_lang_Object *localson =
    Imran> execute_java_constructor(0,"son",sonClass,"()");

I think you want to do the constructor like this:

Hson *localson=(Hson*) execute_java_constructor(0,"son",sonClass,"()");


    Imran>    	execute_java_dynamic_method (0, (Hjava_lang_Object *)
    Imran> print, // real_native.cc, line 161: "handle", "()",
    Imran> localson); return ((Hson *)localson); } //end native
    Imran> function

This call should be 

execute_java_dynamic_method(0,(HObject*) localSon,"print","()V");

    Imran> 	3) I am not very clear about method signatures. With
    Imran> no argument its easy to figure. Can somebody let me know
    Imran> how would I call a java method/constructor with
    Imran> arguments. Please give example.
	
Here's an example of calling a java constructor with arguments
	
execute_java_constructor(0,className,TheClass,"(I)",10)

jeff

 --------------------------------------------------------------------
| Jeff White jsw@cs.brown.edu http://www.cs.brown.edu/people/jsw/    |
| "So you run and you run to catch up with the sun but it's sinking  |
| Racing around to come up behind you again" - pink floyd            |
 --------------------------------------------------------------------
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post