Solved

calling dll written in VB from JAVA

Posted on 2002-07-15
8
318 Views
Last Modified: 2012-06-21
Hi All,

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

0
Comment
Question by:Tension
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 7156528
 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: http://danadler.com/jacob/

  Hope it helps.
0
 
LVL 9

Expert Comment

by:doronb
ID: 7156734
Hi,

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,
Doron
0
 
LVL 3

Expert Comment

by:yasser_helmy
ID: 7157395
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: http://www.codeproject.com/java/javacom.asp
0
 

Author Comment

by:Tension
ID: 7158635
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.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 9

Assisted Solution

by:doronb
doronb earned 25 total points
ID: 7158668
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:
http://developer.java.sun.com/developer/codesamples/jni.html
0
 
LVL 35

Accepted Solution

by:
girionis earned 25 total points
ID: 7158916
>  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.
0
 
LVL 3

Assisted Solution

by:yasser_helmy
yasser_helmy earned 25 total points
ID: 7159788
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.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8917411
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.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now