DLL在Java中使用 [英] DLL Use in Java Like .NET

查看:106
本文介绍了DLL在Java中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,这是Vikas Gohil。



我们在VB.net中使用DLL文件如下:



我在我的应用程序中引用了DLL文件。



然后我按如下方式创建DLL的Object,



Dim Obj作为新的DLL.Class



然后使用这个对象我调用DLL中的函数如下,



Obj.FunctionName()。



如何在Java中使用此功能或者首先是否可以使用此功能?



任何人都可以帮我解决这个问题。



我是Java编程的新手。



任何帮助将不胜感激。



提前谢谢。



很快等待回复。

解决方案

你可以使用System.loadLibrary(String) [ ^ ]



通常的方法是将你的DLL包装在java类中,参见这个例子 [ ^ ]


你想研究Java Native Interface(JNI),它可以做同样的事情,但你需要重写DLL代码。你将无法直接重复使用VB接口。



[我刚才意识到这个问题已经存在了几年,不应该继续追求.. ]

Hello, This is Vikas Gohil.

We Are using a DLL file in VB.net as follows :

I reference the DLL file in My Application.

Then I create the Object of the DLL as follows,

Dim Obj as New DLL.Class

Then Using this object I call functions from the DLL as below,

Obj.FunctionName().

How can I use this functionality in Java OR Is it possible in the first place?

Can Anyone help me in this matter.

I am new to Java programming.

Any Help would be greatly appreciated.

Thanks In Advance.

Awaiting a reply soon.

解决方案

You can load a dll using System.loadLibrary(String)[^]

The usual method is to wrap your DLL in a java class, see this example[^]


You want to research the Java Native Interface (JNI) which can do the same sort of thing but you will need to rewrite the DLL code. You won't be able to reuse the VB interfaces directly.

[I just realized that this issue is a few years old and shouldn't be pursued further...]


这篇关于DLL在Java中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆