Solved

calling dll written in VB from JAVA

Posted on 2002-07-15
8
321 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 116
Java Server Faces parameter pass? 6 50
Arrays.asList  VS  ArrayList 4 60
hibernate example using maven 12 42
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 This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

821 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