

![]() | 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: |
12 messages in net.java.dev.jna.usersRe: Structure| From | Sent On | Attachments |
|---|---|---|
| Paul Loy | Jan 10, 2008 8:29 am | .java |
| Paul Loy | Jan 10, 2008 9:31 am | .java |
| Paul Loy | Jan 10, 2008 9:47 am | .java |
| Timothy Wall | Jan 14, 2008 5:08 am | |
| Timothy Wall | Jan 14, 2008 5:23 am | |
| Paul Loy | Jan 14, 2008 5:46 am | |
| Paul Loy | Jan 14, 2008 8:56 am | |
| Paul Loy | Jan 14, 2008 9:21 am | |
| Timothy Wall | Jan 14, 2008 9:57 am | |
| Timothy Wall | Jan 14, 2008 11:32 am | |
| Paul Loy | Jan 15, 2008 2:05 am | |
| Timothy Wall | Jan 15, 2008 5:41 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: Structure | Actions... |
|---|---|---|
| From: | Paul Loy (kete...@gmail.com) | |
| Date: | Jan 10, 2008 9:31:21 am | |
| List: | net.java.dev.jna.users | |
| Attachments: | ||
Note, new java code attached - fixed the unit test (was not initialising everything)
I have botch fixed the bug (by copying a bit of code from getNativeSize(Class, Object)). I doubt that fix is correct but it gives me the correct sizes and at least lets me get further.
I can now get an instance of VariableStructure2, for example, and call size() on it successfully and get the correct size. But if I try to pass this down to a native method, I get an IllegalArgumentException:
java.lang.IllegalArgumentException: Inline array of class SimpleStructure not supported at com.sun.jna.Structure.writeField(Structure.java:589) at com.sun.jna.Structure.write(Structure.java:460) at com.sun.jna.Function.convertArgument(Function.java:354) at com.sun.jna.Function.invoke(Function.java:191) at com.sun.jna.Library$Handler.invoke(Library.java:206) at $Proxy18.TestStructsInStructs(Unknown Source)
Is this just not implemented yet?
Paul.
On Jan 10, 2008 4:30 PM, Paul Loy <kete...@gmail.com> wrote:
Hi All,
I am trying to create a Variable length Structure, where the variability is the length of an array of Structures inside the Variable length Structure. (please see attached unit tests)
I get a NPE in Structure.getNativeSize(Class, Object) due to the fact that in Structure.getNativeAlignment(Class, Object, boolean), when it finds an Array it sends null as value back into itself:
... else if (type.isArray()) { alignment = getNativeAlignment(type.getComponentType(), null, firstElement); } ...
I guess this is a bug?
Thanks,
Paul.
--
--------------------------------------------- Paul Loy pa...@keteracel.com http://www.keteracel.com/paul
--
--------------------------------------------- Paul Loy pa...@keteracel.com http://www.keteracel.com/paul








.java