|
-
September 21st, 2000, 09:21 PM
#1
calling C DlLL functions
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?
-
January 16th, 2001, 06:11 AM
#2
Re: calling C DlLL functions
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|