Solved

calling dll written in VB from JAVA

Posted on 2002-07-15
8
319 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
best (free) software to access postgres db (java) 1 32
for i loop in grovy 1 44
Java / Linux and Regular Expressions 11 68
thymeleaf natural templating vs JSP 2 65
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

930 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

10 Experts available now in Live!

Get 1:1 Help Now