

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
10 messages in net.java.dev.jna.usersRe: [jna-users] Using custom librarie...| From | Sent On | Attachments |
|---|---|---|
| Jorge Nieto-Madrid | Jan 7, 2009 4:14 am | |
| Timothy Wall | Jan 7, 2009 5:38 am | |
| Jorge Nieto-Madrid | Jan 7, 2009 5:55 am | |
| Timothy Wall | Jan 7, 2009 7:08 am | |
| Jorge Nieto-Madrid | Jan 7, 2009 8:04 am | |
| Timothy Wall | Jan 7, 2009 8:09 am | |
| Jorge Nieto-Madrid | Jan 7, 2009 8:24 am | |
| Timothy Wall | Jan 7, 2009 12:15 pm | |
| Jorge Nieto-Madrid | Jan 8, 2009 6:36 am | |
| Timothy Wall | Jan 8, 2009 6:47 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread 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 8, 2009 6:47:41 am | |
| List: | net.java.dev.jna.users | |
Sorry, JNA doesn't do code parsing.
Your best bet is to write a script to extract them, e.g.
sed -n 's/#define ([A-Za-z_][A-Za-z0-9_]*) ([0-9][0-9]*)/\1 = \2;/g' myheader.h > output.txt
The above will extract all integer constants, but whatever you do will probably still require some hand edits.
On Jan 8, 2009, at 9:37 AM, Jorge Nieto-Madrid wrote:
Thanks so much Timothy.
My application can now "talk" to the robot. I am now implementing all functions of the DLL in Java. Is it possible to extract constants defined with "#define"? It seems that my DLL has a lot of them.
Thanks,
On Wed, Jan 7, 2009 at 9:15 PM, Timothy Wall <twal...@dev.java.net> wrote: 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.
--------------------------------------------------------------------- To unsubscribe, e-mail: user...@jna.dev.java.net For additional commands, e-mail: user...@jna.dev.java.net







