13 messages in net.java.dev.jna.usersRe: [jna-users] array of pointers of ...
FromSent OnAttachments
Zsolt KútiMay 11, 2009 12:18 pm 
Timothy WallMay 11, 2009 12:22 pm 
Zsolt KútiMay 11, 2009 12:46 pm 
Timothy WallMay 11, 2009 1:06 pm 
Zsolt KútiMay 14, 2009 1:30 pm 
Timothy WallMay 14, 2009 1:58 pm 
Zsolt KútiMay 16, 2009 12:19 pm 
Timothy WallMay 16, 2009 6:42 pm 
Zsolt KútiMay 17, 2009 10:32 am 
Timothy WallMay 17, 2009 10:41 am 
Zsolt KútiMay 17, 2009 11:08 am 
Timothy WallMay 17, 2009 12:47 pm 
Zsolt KútiMay 18, 2009 10:33 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] array of pointers of a struct; Was: [jna-users] "Can't determine size of nested structure"Actions...
From:Timothy Wall (twal@dev.java.net)
Date:May 17, 2009 10:41:36 am
List:net.java.dev.jna.users

On May 17, 2009, at 1:33 PM, Zsolt Kúti wrote:

The counterpart of an array of pointers what I need, I just uncertain how to approach that. The API doc says on Structure: When used as a function parameter or return value, this class corresponds to struct*. So I tried passing a variable of my Structure and using its toArray() method with the size that was given back via an IntByReference by the function. This does not seem to work either.

Just to be clear here is the defining C code: struct my_struct int f(struct my_struct *s, int *i)

In usage it looks: static struct my_struct my_s static unsigned int my_i (call) f(&my_s, &my_i) (use) my_s[0]

How does the native code know how many structures it can fill in? Presumably the "int *" will be filled in with the number of elements available, but you need that number before you call the function.

Structure and Structure[] will pass the same address to the native code; the latter will point to a larger block of memory if the array size is greater than one.

What exactly isn't working?