This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Awkward question regarding JNI

 
Shyam Purkayastha
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends
i have got a piculiar question regarding jni.i am a newbie in jni and have tried basic programs from the sun java tutorial.It really worked.
I understand that the method has to be defined as native and the corrosponding code has to be written in c and created into a library file.But whatever examples i have seen uptil now have involved calling only individual methods.Suppose that i have a C++ class library which i want to use in a java program.Obviously it is better to call the library using jni than to create the java equvalent of the library.I want to know wheather it is possible to call c++ objects and their corrosponding methods using jni and if yes then how.
I tried this concept by creating a small class and making objects of it inside a native method but my visual c++ compiler is giving all sorts of errors.Can anybody help.
thanks
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic