This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
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 )