?
Solved

Java Calling the miniLab 1008 DLL's

Posted on 2003-03-12
6
Medium Priority
?
581 Views
Last Modified: 2007-12-19
An interface board called the miniLab 1008 is controlled via DLL (MccMinilab.DLL) calls to read or set the values of it's I/O ports.

The documentation says that the DLL's functions can be called by using MS Visual C++, or MS Visual BASIC.

Is there an -easy- way to call these DLL functions through Java? If you wouldn't mind looking at the functions and things in the DLL documentation, and seeing how easy it would be first, before attempting to answer, because if it is too hard, I suppose learning VB or VC++ won't be too hard.

Ta!
0
Comment
Question by:Lab_Rat
[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
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 8119119
You will have to use JNI to load the DLL. Therefore you will have two DLLs, one created by your JNI routines, and the Minlab one. See http://java.sun.com/docs/books/tutorial/native1.1/
0
 
LVL 1

Author Comment

by:Lab_Rat
ID: 8127380
Hiyah, thanks for the URL, I have one major concern!

If you take a look at this list from the site you gave:

Background
Writing native methods for Java programs is a multi-step process.

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.

All is fine until step 4!
Write the implementation of the native method???
I would try, but unfortunatly it is a DLL that is already written (by a company that most certainly give out source code).

My question is slightly changed therefore:

Can an -existing- DLL be called by the JNI?
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 8127415
>>Can an -existing- DLL be called by the JNI?

Yes. You load the dll in a platform-specific way and then call the methods.
0
 

Expert Comment

by:CleanupPing
ID: 9058743
Lab_Rat:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 35

Expert Comment

by:girionis
ID: 9714410
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:

- Points to CEHJ

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month15 days, 3 hours left to enroll

771 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