Hi, I have a foxpro DLL called as X.DLL. This x.dll is generated from foxpro database. It has three functions which i need to call it from my java code. After lot of researching i found that to invoke a DLL from java i need to create one more DLL like Y.DLL using C/C++
Steps that i followed. 1. Wrote a java Y.java class that loads Y.DLL(Y.DLL doesnt exist now) and declared three native methods. 2. Compiled and generated Y.h file 3. Wrote a Y.c file importing Y.h and implementing native methods with a simple printf statement. 4. Generated a Y.DLL using cygwin\mingw
But i am not understanding where am i refering to X.dll ? which is my target.
Few said that i can invoke only C/C++ DLL's from java? is it true? Few said that i should have a X.h file in hand so that i can import it in Y.c to call methods. I dont have this X.h file I am also confused that whether i need to load X.dll or Y.dll in Step 1 that i have mentioned above. Could anyone please help me. Where am i going wrong? Please help me understand.
I am not a Java programmer and you may not find many VFP guys on the forum who are. On the Java forum I would suggest asking about using this java script syntax: oVFfpDll = new ActiveXObject(x.dll)
and then using the object instead of loadlibrary - a VFP dll is after all an ActiveX COM object. One out fit that is heavy web and COM interop between VFP and everything else is Rick Strahl's WestWind outfit - http://www.west-wind.com
there are also lots of 3rd party COM 2 Java enabling products - search the web for "Instantiate COM objects from Java.