Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invoking FoxPro DLL from Java

843829Jan 12 2008 — edited Jan 14 2008
Hi,
In my java application i need to invoke a FoxPro DLL Lets call this as FoxPro.dll for reference. This FoxPro.dll has three procedures/methods. And i want to invoke these methods from java .

After lot of searching and googling i got to know that , to invoke a external DLL from java i need to create one more DLL using C/C++ lets call it as FoxProJNI.dll which will invoke FoxPro.dll. Please correct me if my understanding is wrong.

To create FoxProJNI.dll i did following steps.

1. I wrote FoxProJNI.java which has three native methods.
a static block to load DLL
System.loadLibrary("FoxProJNI");

Which DLL should i mention here ? FoxPro.dll or FoxProJNI.dll?????

As of now i am loading FoxProJNI in this java class.

2. I compiled the java class and created header file.

3. I wrote a C file which includes header file. This C file has again three methods which do nothing as of now. They just print some message.

4. I compiled the C file and then created a FoxProJNI.dll using cygwin mingw.

My question here is
1. how should my FoxProJNI.dll calls the FoxPro.dll??? where should i code that???


Could anyone please help me in this....

i already have FoxPro.dll that has to be invoked from java.
i created a FoxProJNI.dll but i am not getting how should i call FoxPro.dll from this.
Should i mention in C file or i should load FoxPro.dll in java class

sorry if i am confusing you guyz... but i am really frustrated. this is first time i am working on JNI. I really dont have much knowledge . I have gone through lot of JNI tutorials and i have searched for this question on net also , but no one is telling where one dll is refering other dll.
Every one is telling how to create our dll rather telling how to invoke the external dll...



thanks in advance

Edited by: hamz2008 on Jan 12, 2008 5:37 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2008
Added on Jan 12 2008
7 comments
657 views