HOW I CAN CALL A DLL FILE IN JAVA

PLZ CAN ANY BODY WRITE CODE HOW I CAN USE VB DLL FILE IN MY JAVA CODE.HELP
[102 byte] By [waqar2004] at [2007-9-26 3:36:44]
# 1

You can get very usefull information on the Java Tutorial, take a look at the JNI chapter.

Basically, what you'll have to do is (from the tutorial):

1.Begin by writing the Java program. Create a Java class that declares the native method; this class contains the declaration or

signature for the native method. It also includes a main method which calls the native method.

2.Compile the Java class that declares the native method and the main method.

3.Generate a header file for the native method using javah with the native interface flag -jni. Once you've generated the header

file you have the formal signature for your native method.

4.Write the implementation of the native method in the programming language of your choice, such as C or C++.

5.Compile the header and implementation files into a shared library file.

6.Run the Java program.

As your DLL is from VB, I gess you will have to write a C DLL as the native method implementation, which in turn calls the VB DLL. Not sure 'cause I do not know VB, but I suppose you cannot use C headers on VB.

U063667 at 2007-6-29 12:08:28 > top of Java-index,Archived Forums,Java Programming...
# 2
The Java Tutorial is on http://web2.java.sun.com/docs/books/tutorial/
U063667 at 2007-6-29 12:08:28 > top of Java-index,Archived Forums,Java Programming...
# 3
I will send source at your email address pass me your email address.
leewaqar at 2007-6-29 12:08:28 > top of Java-index,Archived Forums,Java Programming...
# 4
My Email is thiswaqar@petrosin.com
waqar2004 at 2007-6-29 12:08:28 > top of Java-index,Archived Forums,Java Programming...
# 5
It's so great to find this solution, I have the same question, could you send me the source code? Thank you so much.my email is jli_68@email.com
jli_68 at 2007-6-29 12:08:28 > top of Java-index,Archived Forums,Java Programming...
# 6
please send me the code too:wwjja@woolworths.co.za
JonathanJ at 2007-6-29 12:08:28 > top of Java-index,Archived Forums,Java Programming...
# 7
thank god i finally found someone who can help me with the sample codeshall be waiting eagrly for the codethanks in adavance...PriyankaMy email is contactpriyanka@yahoo.com
PriyankaS at 2007-6-29 12:08:28 > top of Java-index,Archived Forums,Java Programming...