• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Awkward question regarding JNI

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
We don't have time for this. We've gotta save the moon! Or check this out:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic