I'm probably the only person in the world that wishes to do this but here goes. I have some C code which defines a few structures. I want to use these structures inside my java code but don't know how to represent them. There isn't any typedef or struct inside of java so I am clueless as to how to use them from within my java code. Does JNI support passing these types back and forth between java and native code? Can classes be defined as native and defined in native code? Thanks, Frank
posted 16 years ago
No, classes can't be defined native. As for structures - since Java doesn't have structures, you have to define a class with fields only and then access this fields copying data from/to your native structures. You can't pass a custom structure to/from JNI.
------------------ With best of best regards, Pawel S. Veselov ( aka Black Angel )
With best of best regards, Pawel S. Veselov ( aka Black Angel )