?
Solved

calling dll written in VB from JAVA

Posted on 2002-07-15
8
Medium Priority
?
329 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.
Suggested Courses

649 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