2 messages in net.java.dev.jna.users[jna-users] Pointer to array of struc...
FromSent OnAttachments
Anderson ShigaDec 12, 2008 1:32 pm 
Timothy WallDec 12, 2008 4:14 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:[jna-users] Pointer to array of structs (**str)Actions...
From:Anderson Shiga (ash@gmail.com)
Date:Dec 12, 2008 1:32:29 pm
List:net.java.dev.jna.users

Hi,

Can somebody give me a code sample of getting a pointer to an array of structs from C as a function parameter?

example of structure:

typedef struct abc { int a; int b; char c; } str;

C function to access which returns the pointer:

void getIt(str **x)

I tried to use PointerByReference on the Java side, but I don't know how to convert the PointerByReference (and if that's the correct class to be used!) object returned into a Java Structure class. I couldn't find any method that would allow me to convert a Pointer or a Pointer[] into an Object and then into the desired Java Structure.

Thanks!