简体   繁体   English

通过Java调用.DLL文件

[英]calling .DLL file through java

I have a DLL file mostly written in vb.net It will take 2 parameters. 我有一个主要用vb.net编写的DLL文件,它将带有2个参数。 I am suppose to make use of this DLL in my java code and pass required 2 parameters. 我想在我的Java代码中使用此DLL并传递所需的2个参数。 How should I go about it? 我应该怎么做?

Use JNI , Load your dll and call native functions 使用JNI ,加载dll并调用本机函数

See 看到

In Java there's basically two good options for this: (in order of recommendation) 在Java中,基本上有两个不错的选择:(按推荐顺序)

  1. If your DLL has C function headers (rather than C++ decorations), you should use JNA . 如果您的DLL具有C函数标头(而不是C ++装饰),则应使用JNA It has a simple, declarative syntax and only requires writing some Java. 它具有简单的声明式语法 ,只需要编写一些Java。
  2. Write JNI bindings for your DLL (there'll be some Java and some C++ code involved). 为您的DLL编写JNI绑定(将涉及一些Java和一些C ++代码)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM