Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

JNI only able to call static Java functions  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have written some JNI code to display a javabean in an MFC container. I am using this example as a base for my work: http://www.codeproject.com/cpp/JavaBeanInMFCDialog.asp

The first problem I'm having is that I am only able to call STATIC functions in java from c++. Is this supposed to happen?

Second, is it easier to use the Java ActiveX Bridge to do this, than how this example does it?

I'd appreciate any feedback, thank you!
 
author and iconoclast
Posts: 24203
43
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be able to call any Java methods -- of course, to call non-static methods, you need a Java object on which to call them. What problem are you having?

In any case, using the ActiveX bridge is certainly an alternative, and yes, should be easier than writing your own JNI code.
 
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!