简体   繁体   English

JNA指针通行证

[英]JNA Pointer Pass

test.h 测试

struct test{

char  *pCarrierName;

}

And Equivalent JNA Syntax is- 而等效的JNA语法是-

public static class test extends Structure {

    public Pointer pCarrierName;    
      public test( Pointer pCarrierName) {

                super();     

                this.pCarrierName = pCarrierName;


            }
}

Now how can i instantiate this "test" class? 现在如何实例化该“测试”类? Actually i want to do following this type of call- 实际上,我想按照这种类型的电话进行操作

public static void main(String[]args){
       test ob = new test("AIR GAS");
}

The structure field should be of type String; 结构字段的类型应为String; then you can initializer the structure and its field with the original String argument. 那么您可以使用原始的String参数初始化结构及其字段。

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

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