10 messages in net.java.dev.jna.usersRe: [jna-users] Using custom librarie...
FromSent OnAttachments
Jorge Nieto-MadridJan 7, 2009 4:14 am 
Timothy WallJan 7, 2009 5:38 am 
Jorge Nieto-MadridJan 7, 2009 5:55 am 
Timothy WallJan 7, 2009 7:08 am 
Jorge Nieto-MadridJan 7, 2009 8:04 am 
Timothy WallJan 7, 2009 8:09 am 
Jorge Nieto-MadridJan 7, 2009 8:24 am 
Timothy WallJan 7, 2009 12:15 pm 
Jorge Nieto-MadridJan 8, 2009 6:36 am 
Timothy WallJan 8, 2009 6:47 am 
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] Using custom libraries (dll)Actions...
From:Timothy Wall (twal@dev.java.net)
Date:Jan 7, 2009 12:15:08 pm
List:net.java.dev.jna.users

NativeLibrary.getInstance() will only ever instantiate a single instance of your DLL. Native.loadLibrary uses that very call behind the scenes. So the example you indicate below is appropriate and correct.

Sorry for not being more accurate with the API references, I don't keep that stuff on the top of my head.

On Jan 7, 2009, at 11:24 AM, Jorge Nieto-Madrid wrote:

I'm sorry:

I just try at first the instruction:

Saphira.INSTANCE.getGlobalVariableAddress('sfIsConnected').getInt(0)

But Eclipse did not recognise getGlobalVariableAddress as a member of Saphira.INSTANCE (because Saphira.INSTANCE is not a NativeLibrary class) So I had to use:

-- "NativeLibrary .getInstance ("SF").getGlobalVariableAddress("sfIsConnected").getInt(0)"

But I think the function getInstance generates another instance of the DLL. I just wanted to use the existing one (Saphira.INSTANCE). Just the you proposed: "Saphira.INSTANCE.getGlobalVariableAddress('sfIsConnected').getInt(0)"

As I said, I tried that but the compiler returns an error: The method getGlobalVariableAddress(String) is undefined for the type Saphira

Greetings,

jorgento

Timothy Wall schrieb:

On Jan 7, 2009, at 11:05 AM, Jorge Nieto-Madrid wrote:

void sfStartup(HANDLE hInst, int nCmdShow, int async); void sfOnConnectFn(ConnectInterface cI); //Use a non-native function pointer (callback) void sfOnDisconnectFn(ConnectInterface cI); //Use a non-native function pointer (callback) //...More functions }

What should I change so I can use the instruction you propose? Saphira.INSTANCE.getGlobalVariableAddress('sfIsConnected').get

I don't understand what you're asking.