how to create a dll of my c++ code. [duplicate]
Possible Duplicate:
how dll created out of c++ source and how it is used in other sources?
I need to call a c++ code, which get the开发者_运维百科 PID/VID of the external device in my java code. I googled and some info. By converting the c++ code to a dll, I can use it in my java code. Any suggestion to how to convert my c++ code to a dll file.
What you are looking for is JNI (Java Native Interface).
Here is a link for compiling a dll using VC++ - http://www.tidytutorials.com/2009/07/java-native-interface-jni-example-using.html
and one using MinGW - http://www.mingw.org/node/41
Find step by step process to make dll with VC++ here.
Also you need to use JNI for using c++ dll into your java project.
精彩评论