Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI only able to call static Java functions  RSS feed

 
Kelvin Jones
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!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!