mapping between Java and native return types
1 posts in topic
Flat View  Flat View

Posted By:   Matthew_DeRoller
Posted On:   Sunday, May 20, 2001 03:10 PM

Hello, I have a 3rd-party API written in C than I want to use in a Java application. I'd like to create JNI wrappers for these C functions but I don't know how to handle their unique return types. I want to reference native types in my Java methods. I'm new to JNI. All of the examples I've been able to find online are simple HelloWorld, printf kinds of things.

Thanks for the help!

Re: mapping between Java and native return types

Posted By:   Alexander_Krapf  
Posted On:   Sunday, May 20, 2001 07:12 PM

Hi Matthew,

First, get one or two good books. I recommend Sheng Liang's and Rob Gordon's books.

Second, look at the tutorial. You can find the links to it on this page.

Third, write some testcases with the API you have to wrap.

Fourth, when you've made up your mind that you don't want to spend the rest of your career debugging type errors and reference leaks, look at our JunC++ion tool. JunC++ion will take Java classes as input and generate corresponding C++ proxy classes that you can use in the implementations of native methods. It also generates exceptionsafe and typesafe delegating native method implementations.

Find out more about it at http://www.codemesh.com.

Good luck,


About | Sitemap | Contact