简体   繁体   English

使用Java本机访问库(JNA)将指针传递给结构

[英]Passing Pointer to Structure using Java Native Access Library(JNA)

Is it possible to pass pointer to structure using JNA? 是否可以使用JNA将指针传递给结构? Suppose I have a method now i want to call this method using java. 假设我现在有一个方法要使用java调用此方法。

void calculate_Hx(struct a *); void compute_Hx(struct a *);

In a word: yes. 一句话:是的。 JNA lets you manipulate struct and union objects from Java, including passing them as arguments to functions. JNA允许您从Java操作structunion对象,包括将它们作为参数传递给函数。 Here's a relevant bit of the documentation. 这是文档的相关部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM