• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to call .dll in java

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, i have one .dll, i have execute the dll (bcos it will give some info) , the output should be stored in one file. and how to call .dll, and how to and stored in a file, using java.
waiting for reply.
cheers
nr konjeti
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
As far as i know dll can't be called inside a java code directly.
But u can call them using java native interface(JNI)
(write a c program to call the dll and use JNI for calling the program).
A bit of google search will show lots of examples available in the net.
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically you write a C wrapper around the DLL using a header file that javah will generate for you. Try this google search for more JNI info:
http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=java+%2Bjni
Warning, JNI is pretty advanced and does break the platform independance. You may want to make sure that there is no other way to do what you are trying to do.
Hope this helps.
reply
    Bookmark Topic Watch Topic
  • New Topic