Re: Loading of dll file



Hi,
Thanks for the reply, Now i have loaded the dll file using Regsvr32
command option from the windows.Now the problem is how do i import this
in my java application and use the inbuilt methods.

Gordon Beaton wrote:
On 29 Aug 2006 23:58:44 -0700, vinaymvbhat82@xxxxxxxxx wrote:
I had a doubt in java related to loading of dll files.The first thing
is how to load the dll file in java and then how to retrive the
methods/functions from the dll files.Can anybody help me, please.

System.load() or System.loadLibrary() will load a DLL.

If it's been written specifically for use with Java, the methods it
contains will belong to Java classes. You can use those methods the
same way you use any Java methods, i.e. you don't do anything
different just because they're in a DLL.

If it hasn't been written for use with Java, then you need to create a
new DLL that follows the rules and naming conventions of JNI and load
*that* instead. From there, you can make calls to the original DLL.

/gordon

--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e

.



Relevant Pages

  • Re: Java programmer lured back by .Net (Questions)
    ... in .NET a form is simply a class so yes it could easily be placed into a DLL and then use Ngen to make a native image of it. ... Of course it learned a lot from Java, and improved upon many things which Java is slowly catching up on. ... As far as code security you're in the same boat as Java since it compiles down to MSIL instead of bytecode of which both can reverse engineered very easily. ... I would like to be able to place my executable on my remote server and then "load" the executables on demand from accross the internet - so that there are no executables on the local machine for prying eyes to reverse engineer. ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Java programmer lured back by .Net (Questions)
    ... in .NET a form is simply a class so yes it could easily be placed into a DLL and then use Ngen to make a native image of it. ... Of course it learned a lot from Java, and improved upon many things which Java is slowly catching up on. ... As far as code security you're in the same boat as Java since it compiles down to MSIL instead of bytecode of which both can reverse engineered very easily. ... My backend is pure Java running on Unix - but because SWING is so ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Delete dll
    ... >I want to unload the dll after use so I can delete the stored .dll file from ... >How do I unload the dll, or release the file so it may be deleted? ... You can explicitly load the library before calling anything in it ...
    (microsoft.public.vb.com)
  • Re: Delete dll
    ... >I want to unload the dll after use so I can delete the stored .dll file from ... >How do I unload the dll, or release the file so it may be deleted? ... You can explicitly load the library before calling anything in it ...
    (microsoft.public.win32.programmer.ole)
  • Re: JNI EXCEPTION_ACCESS_VIOLATION
    ... I am not experienced in coding a dll and access it via ... Java, but, I would say to you that, if you do not mind, try to use the ... The code will crash when running under XP Service Pack 2 ... The code will NOT crash when running under Windows 2000 Service Pack 4 ...
    (comp.lang.java.programmer)