aspose file tools*
The moose likes Java in General and the fly likes java - DLL communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "java - DLL communication" Watch "java - DLL communication" New topic
Author

java - DLL communication

vijay kumar
Ranch Hand

Joined: Nov 10, 2006
Posts: 62
Hi,
i want to call a DLL from my java code and need to pass some parameter to it.

can any one help me how to comunicate with DLL through java.

Thanks in advance

Regards,
Vijay.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41865
    
  63
There would need to be some kind of JNI wrapper between the Java code and the DLL. Libraries like Jacob or JCom can remove much of the pain of creating these.
[ July 26, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Timothy Wall
Greenhorn

Joined: Sep 14, 2002
Posts: 14
Originally posted by vijay kumar:
Hi,
i want to call a DLL from my java code and need to pass some parameter to it.

can any one help me how to comunicate with DLL through java.



JAWIN and JACOB provide good access to COM-based DLLs. JNA provides easy access to DLLs which export a standard C interface.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14150
    
  18

JNI is the standard API to call native code, such as functions in a DLL. However, JNI can be hard to use and may require you to write some C or C++ code.

There are some libraries to make working with native code easier. Have a look at these ones:

NativeCall - Call native methods from Java without JNI
J/Invoke - The easy JNI replacement

These allow you to call native functions without having to write native wrapper functions yourself.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java - DLL communication