Click to See Complete Forum and Search --> : calling C DlLL functions


mce16
September 21st, 2000, 09:21 PM
Hi, i have a few questions, your help is appreciated..thanks

1) Is it possible to call C++ functions from Java?
if yes, can u give me an example? I can't find any doc on this.

2) If i have a fucntion in C dll which needs to deal with with unsigned char*, what shall i put in java to replace this? use String in java?

3) If i make call to other Win32 API functions as well in my C dll function which is used by java, do i need to do any other extra work?

Ata ul Haq
January 16th, 2001, 05:11 AM
Hi

1. To call C++ functions from Java u have to create a DLL of ure C++ functions. For that, u can use JNI. A very good tutorial
(with example) is available at java.sun.com. Search for "JNI" on the site and u'll find it.

2. Since there are no pointers in Java, so u can not replace char * with anything. Using String can be one option. In the advance JNI
topics on java.sun.com, they have mentioned few tips. You can find more help in this regard by searching for JNI tutorials on web

3. I am not sure about this.. but i think there is nothin much to be done except that u have to include the API decleration
in ure DLL as well