I could try to explain what I would like to do, but I think a little code would be much easier to understand. So here goes:
C++ class:
Expand|Select|Wrap|Line Numbers
- class Cclass
- {
- void some_C_function(int i)
- {
- printf("%d\n",i);
- }
- };
Expand|Select|Wrap|Line Numbers
- Class Jclass extends Cclass
- {
- public void some_Java_function(int i)
- {
- some_C_function(i);
- }
- }
Expand|Select|Wrap|Line Numbers
- int main()
- {
- Jclass *j = new Jclass;
- j->some_Java_function(5);
- return 0;
- }
Maybe the java class should not extend the c++ class but have the function available in some other way?
I've read a little about CNI - but it seems that it only enables the calling of java methods from C++, and not the other way around.
So my questing is this: Can the above be done, or should I look into some other solution to the scripting language problem.
Thanks