

![]() | 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: |
9 messages in net.java.dev.jna.usersRe: [jna-users] Need help for beginner| From | Sent On | Attachments |
|---|---|---|
| Hao Jiang | Feb 10, 2009 3:16 pm | |
| Daniel Kaufmann | Feb 10, 2009 4:58 pm | |
| Timothy Wall | Feb 10, 2009 5:00 pm | |
| Hao Jiang | Feb 11, 2009 9:08 am | |
| Hao Jiang | Feb 11, 2009 12:53 pm | |
| Timothy Wall | Feb 11, 2009 2:09 pm | |
| Timothy Wall | Feb 11, 2009 2:11 pm | |
| Hao Jiang | Feb 11, 2009 2:35 pm | |
| Hao Jiang | Feb 12, 2009 9: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: [jna-users] Need help for beginner | Actions... |
|---|---|---|
| From: | Timothy Wall (twal...@dev.java.net) | |
| Date: | Feb 11, 2009 2:11:31 pm | |
| List: | net.java.dev.jna.users | |
Use Structure.toString and set -Djna.dump_memory=true to see the raw contents of the structure memory. This can help you figure out where the structure alignment is going awry.
On Feb 11, 2009, at 3:53 PM, Hao Jiang wrote:
Hi All
I made some progress, I think it's a data type issue (unsigned short in C), my code
typedef struct { char* a; StructA sa; StructB* sb; double c; double d; } Info;
One data type in StructA is unsigned short, I use short in java code
public static class StructA extends Structure{ public int x; public short y}
public static class Info extends Structure{ public String a; public StructA sa; public Pointer sb; public double c; public double d; }
I got error message when run the above code: Invalid memory access
But after comment out y, like this public static class StructA extends Structure{ public int x; // public short y}
I can run the code, and be able to read String a in Info and X in StructA, but I got 0.0 for both c and d which shouldn't be.
How can I mapping unsigned short in java?
Thanks
Hao
*************************************************************************
PRIVILEGE AND CONFIDENTIALITY NOTICE:
The information in this email is intended for the named recipients only.
It may contain privileged and confidential information. If you have
received this communication in error, any use, copying or dissemination
of its contents is strictly prohibited. Please erase all copies of the
message along with any included attachments and notify Intermap
Technologies or the sender immediately by telephone at the number
indicated on this page.
*************************************************************************







