> If I have only the C part, I would cast the "native1" object, pass
> to "setup" and cast back the object, but since the setup function is
> called from java, I don't know how to access native1 object from
> "setup". Is it possible?
Of course.
Either store it someplace in the native code where it's visible to
both methods (i.e. not as a local variable in solve() like your
example).
Or, remembering that even native methods have return values, return it
to the caller (cast to jlong) so that it can be passed back to the
next method, where you cast it back to the appropriate pointer type
before attempting to use it.
/gordon

Signature
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Edsoncv - 02 Mar 2007 18:49 GMT
> > If I have only the C part, I would cast the "native1" object, pass
> > to "setup" and cast back the object, but since the setup function is
[quoted text clipped - 17 lines]
> [ don't email me support questions or followups ]
> g o r d o n + n e w s @ b a l d e r 1 3 . s e
Thanks Gordon, I think I'll pick the second option.