?
Solved

calling dll written in VB from JAVA

Posted on 2002-07-15
8
Medium Priority
?
328 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
LVL 9

Assisted Solution

by:doronb
doronb earned 100 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 100 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 100 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn different types of Android Layout and some basics of an Android App.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

765 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