[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

JNI complex java objects

Posted on 2006-04-11
7
Medium Priority
?
239 Views
Last Modified: 2013-11-23
Hi and thanks in advance,
I am using JNI interface to call a C++ library. On some of the library functions I have to pass complex structures. What is the best way to do it?
Thanks,
Guy
0
Comment
Question by:aquasw
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 16424187
Create a Java class with the correct fields. On the native side, unpack them and forward to C++
0
 

Author Comment

by:aquasw
ID: 16424703
Can you explain what do you mean by "unpack them and forward to C++". It's not a list of parameters it's a tree structure.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16424737
Then you need to pass a class that encapsulates a tree
0
 

Author Comment

by:aquasw
ID: 16427950
How do I brows a java object that was pass to the c++. it's a jobject what can I do with it?
Can I get the members of the object?
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 16428144
You can manipulate objects in native code by getting their fields. I suggest you take the Sun JNI tutorial

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question