3 messages in net.java.dev.jna.users[jna-users] Issue with nested structure
FromSent OnAttachments
Bruno MedeirosJun 9, 2008 12:15 pm 
Bruno MedeirosJun 9, 2008 12:33 pm 
Bruno MedeirosJun 9, 2008 12:35 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] Issue with nested structureActions...
From:Bruno Medeiros (brun@gmail.com)
Date:Jun 9, 2008 12:33:20 pm
List:net.java.dev.jna.users

Hi there. I have a mapping scenario very much like the "Nested Structure Definitions" in https://jna.dev.java.net/javadoc/overview-summary.html , where I have a pointer to a structure within my containing structure, and in which I used the ByReference tag to mark the nested structure as a reference.

The problem I have, is that in JNA native function call, when the containing structure is marshalled, only the containing structure is serialized, and not the nested structure (its native memory block remains uninitialized, with zeros). I ran it throught the debugger with JNA's source code, and the write() method of the nested structure is never called. Is this normal behavior? Do I have to manually call the write() method of the nested structures?