File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes How to access out parameters in c++ dll Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to access out parameters in c++ dll" Watch "How to access out parameters in c++ dll" New topic

How to access out parameters in c++ dll

Kedar Saravate

Joined: Mar 01, 2007
Posts: 5
I am developing C++ DLL for JNI application.
Here while calling methods from java, I am sending local parameter.
They will modified internally by the method written.
But their value is not reflecting outside.(Values get modified at their addresses).
Modified value must reflect for further use.
How can I access that value?
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
It's not clear to me exactly what you're asking. It's probably not clear to anyone else, which is why there are no replies. You may have more luck if you give some concise code examples.

A Java native method is like any other Java method, when called by Java. The parameters are all passed by value. There are no OUT parameters in Java. The ways for the caller to receive information from the method call are first and foremost the return value, and second the side effects. An exampler of side effects is that the method call can change the data in one or more Java objects.

The C++ implementation of a Java native method can perform Java method calls or can directly change the data in Java objects. Look at the JNI API in detail to see how to do that.

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
I agree. Here's the link:
subject: How to access out parameters in c++ dll
jQuery in Action, 3rd edition