• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Using JNI interface, how to go both ways to between JObject and C++ list structure

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to invoke C++ function in Java. I have created the JNI interface and the signature of the native method is as follows:
JNIEXPORT void JNICALL Java_mmm_XXX
(JNIEnv *, jclass, jint, jobject, jstring, jobject, jobject);
I need convert the passed parameter jobject (which is a java.lang.List) object to a c++ List type so that it can be passed to the C++ method YYY which actually does the work.
I also need convert the return value of YYY from C++ List to JAVA jobject of java.lang.List type.
I know how to convert String, array from what I learned from Java tutorial, but have no clue about more complex types.
I really appreciate your help.
 
He does not suffer fools gladly. But this tiny ad does:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic