calling dll written in VB from JAVA

Hi All,

    I'm new to JNI.I wann to call a dll written in VB from java.please guide me.

Who is Participating?
girionisConnect With a Mentor Commented:
>  We don't want to use any 3rd party to call the native methods in the vb dll & we need use pure java.

  This is not possible (at least to the best of my knowledge) by using the stanard Java libraries. If you do not want to use a thrid party API you can either use MS J++ to do it or write a wrapper C++ object. You will have to call methods in this wrapper object (via JNI) and this in turn will be calling the methods in the VB object.

  Hope it helps.
 You cannot do it straight away. You need to either write a wrapper class (C or C++) or use a third part API. Take a look here:

  Hope it helps.

If you have VB, maybe you also have Visual J++, if you do, then you can wrap your VB dll with a Java class and use that class from your regular Java classes. Visual J++ handles this sort of thing much more conviniently than any other tool I've heard of.

Hope this helps,
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi Tension,
I think a similar question was asked a few days ago but i dont remeber the question number. It was about using activex controls inside java. An answer was accepted.
Take a look at:
TensionAuthor Commented:
Hi All,
   We don't want to use any 3rd party to call the native methods in the vb dll & we need use pure java.
doronbConnect With a Mentor Commented:
You could probably lookup a Sun tutorial about JNI and native libraries to see how to bind Java methods to native methods loaded from Windows DLL or Unix Shared Objects.

Maybe something like:
yasser_helmyConnect With a Mentor Commented:
Hi Tension,
using pure java to access the vb dll directly is not possible. The dll must have an interface that the jvm can understand. The native methods must be compatible with the jni interface. Maybe there is a jni interface to vb like the one for c.
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- split points between girionis, doronb and yasser_helmy

Please leave any comments here within the
next seven days.


Cleanup Volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.