• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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
Sheriff
Posts: 24220
40
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!