Java native interface

I'm want to write a gui using java and then use JNI to interface the gui with c++ code. How is the c++ code treated?  Is it treated as part of the java code? Does the c++ code run on it's own stack or does it run on the same stack that the java code is running on?  Will the c++ code be able to store and retreive it's own data structures?
AixsarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vivexpCommented:
Hi,

As regarding ur last que,
yes the c++ code can access its data structure and manipulate with it. Ur c++ code can event return data types like string, int, etc

Visit this site for more info

http://www.javaworld.com/javaworld/javatips/jw-javatip17.html

Best of luck
0
vaskarthikCommented:
THe C++ code is treated by java as a separate dll functionality code.

It wont be treated as part of java code. example we use functions like printf() . Only the line calling the function belongs to our code.

Since the C++ code is part of the loaded dll, it will run on a separate stack. The c++ code could use all allowed C++ data types internally. But while returning it should return in specific java dependend strings.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.