开发者

using functions in dll, in java

I have some dll files(not custom 开发者_C百科and not written by me) and I need to use the functions, that are c/c++ written, in these files in my java project. I googled and read many examples about JNI but they were all about writing your own program and dll and then reaching them. Also I don't think dllexport exists in these dlls, so dllimport/dllexport method is not available I guess. How can I reach these functions? Thanks in advance..


I'm sure, you looked at the JNI Tutorial at oracle already. I had a quick look at the part, where a native function is implemented and a dll is compiled and I don't think, that special conditions have to be met.

I'd give it a try with a single, easy function from that dll:

  1. Write a simple class with just main method that uses one of the native methods (with easy parameters to have an easy start)
  2. Generate the header file and
  3. run the test application

If the dll is not 'jni compliant' (whatever that means), you'll know by then and then you probably know that you have to recompile the native code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜