4 messages in net.java.dev.jna.usersRe: [jna-users] put DLL into a Jar
FromSent OnAttachments
Jiang, HongyiSep 1, 2008 3:42 am 
Paul LoySep 1, 2008 3:53 am 
prashantSep 1, 2008 4:08 am 
prashantAug 5, 2009 11:38 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] put DLL into a JarActions...
From:Paul Loy (pa@keteracel.com)
Date:Sep 1, 2008 3:53:16 am
List:net.java.dev.jna.users

I think JNA copies it's jnidispatch.dll to the temp folder before loading it in. Maybe do that?

Paul.

On Mon, Sep 1, 2008 at 11:43 AM, Jiang, Hongyi <jia@ugs.com> wrote:

Hi everyone,

I have an executable jar file, which calls a DLL file. I can access the DLL file using following code:

* *

*public* *interface* License *extends* Library {

*public* License *INSTANCE* = (License)Native.*loadLibrary*( ".\\Prop\\License.dll", License.*class*);

*void* checkLicense(*byte*[] pszLicEnc, *byte*[] pszLicReturnEnc,
*int*iBlockLength);

}

However, I don't want to deploy this DLL file outside of this executable Jar.

Can anybody tell me, how to write the code to access this DLL file, which is deployed to a Jar file.

I have tried the following code, It works in Eclipse, but it doesn't work, if I double click the Jar file.

public License INSTANCE = (License)Native.loadLibrary(new File(Main.class.getResource("*cfg*/*lang*/License.*dll*").toURI()).getAbsolutePath(), License.class);

Thanks

Hognyi