• 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 ...
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

How to access out parameters in c++ dll

Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
This looks like a job for .... legal tender! It says so right in this tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic