Manipulating C++ Objects in Java Through JNI

Hi,

I have some existing C++ classes objects that I would like to access through Java methods. However, if I use a java method to create an instance of a C++ object, and then I want to edit the state of that C++ object through java, how do I reference the correct C++ object.

For example, if I have a C++ object called Ball, with two variables x and y representing its position and a constructor as well as set methods to set x and y. I then make a java class Ball with the same variables, constructor, and setter methods. But when the java constructor is called, I want the C++ version to be created, and when the java setter methods are called, I want the x and y of the correct C++ Ball instance to change.

Is this is possible, and if so what are the steps needed?

Thank you

[809 byte] By [csb42a] at [2007-11-27 8:19:14]
# 1
See example with C++ structure in http://www.sharewareplaza.com/Java-Platform-Invoke-API-Demo-version-download_49212.html
vitallisa at 2007-7-12 20:07:22 > top of Java-index,Java HotSpot Virtual Machine,Specifications...