1

I have a DLL file mostly written in vb.net It will take 2 parameters. I am suppose to make use of this DLL in my java code and pass required 2 parameters. How should I go about it?

user1570824
  • 37
  • 1
  • 6
  • possible duplicate of [Calling C++ dll from Java](http://stackoverflow.com/questions/9485896/calling-c-dll-from-java) & [Calling .NET DLL from Java](http://stackoverflow.com/questions/8477752/calling-net-dll-from-java) – Alex K Aug 16 '12 at 13:21

2 Answers2

3

Use JNI, Load your dll and call native functions

See

jmj
  • 237,923
  • 42
  • 401
  • 438
3

In Java there's basically two good options for this: (in order of recommendation)

  1. If your DLL has C function headers (rather than C++ decorations), you should use JNA. It has a simple, declarative syntax and only requires writing some Java.
  2. Write JNI bindings for your DLL (there'll be some Java and some C++ code involved).
Mark Elliot
  • 75,278
  • 22
  • 140
  • 160
  • Hi Mark, as I stated in my first post, DLL is a pure vb.net code. So I should go abt having JNI. Any samples you have to know wat exactly needs to be done in C++ – user1570824 Aug 16 '12 at 05:17