java - How do I obtain a Structure.ByReference from a Structure using JNA? -
java - How do I obtain a Structure.ByReference from a Structure using JNA? -
i have object of construction in java code. jar generated using jnaerator expects structure.byreference info type. there method in jna or code snippet convert construction object structure.byreference object?
generally, don't need explicitly specify structure.byreference when passing parameters. if it's parameter, can drop .byreference signature , it'll work fine.
if it's field within structure, jna interprets structure value, in case would need provide .byreference explicitly.
this 1 way it.
class mystructure extends construction { class byreference extends mystructure implements structure.byreference { public byreference() { } public byreference(pointer p) { super(p); read(); } } public mystructure() { } public mystructure(pointer p) { super(p); read(); } } mystructure s; // ... mystructure.byreference ref = new mystructure.byreference(s.getpointer()); java c jruby jna
Comments
Post a Comment