5 messages in net.java.dev.jna.usersRe: [jna-users] Nested Structure elem...
FromSent OnAttachments
Michael WhiteJul 25, 2008 2:45 am 
Timothy WallJul 25, 2008 9:49 am 
Michael WhiteJul 25, 2008 10:26 am 
Michael WhiteJul 26, 2008 12:31 am 
Timothy WallJul 27, 2008 8:09 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:Re: [jna-users] Nested Structure elements arriving uninitialized.Actions...
From:Timothy Wall (twal@dev.java.net)
Date:Jul 27, 2008 8:09:29 pm
List:net.java.dev.jna.users

On Jul 26, 2008, at 3:31 AM, Michael White wrote:

Hi,

I stripped the code down to the bone, using all default values in the Structure declaration, to try and isolate the problem.

What I found was that I have to force the alignment to ALIGN_NONE, otherwise it fails. I'm using javac on JDK 1.5.0_5 if that makes a difference. Running on Windows XP sp2. write() had no impact.

Any idea why I would need to use ALIGN_NONE?

If your structure definition is preceded by a "#pragma pack(0)", then it needs ALIGN_NONE. There are a few w32 API headers that do this.