cni converting String args[]

littlejohn@paranoici.org littlejohn@paranoici.org
Fri Dec 10 16:59:00 GMT 2004


* Andrew Haley (aph@redhat.com) ha scritto:
>  >       arguments[i] = (char *) elements(argsElements[i]->getBytes());
> 
> If you want chars, you'll need an encoding -- elements returns a
> jchar*.  Try JvGetStringUTFRegion.

 ok, I'll let you know
 
>  > 
>  >  What am I missing?
> 
> I'm not exactly sure, but I wonder if something is being GCd under
> your feet.  Is everything here called from Java code, or do you have a
> pointer to a Java type stashed in native code somewhere?

 This method is called by a class constructor:

    public A(String[] args) {
        this.id = create();
        init(args);
    }

 where the args are given to this constructor directly by the static main
application method.
 
> Andrew.

 thanks,
 lj



More information about the Java mailing list