structTable是指向MyStruct的指针
MyStruct structs[3];
myobject.structTable = &structs[0]
myobject.structTableSize = 3;
我如何在Java中使用JNA?
答案 0 :(得分:0)
含糊的问题。含糊的答案。如果您要创建新的/空的结构,则此方法应该起作用。
MyStruct struct = new MyStruct();
MyStruct[] structs = (MyStruct[]) struct.toArray(3);
myobject.structTable = structs; // Java Object pointing to structure array
long cPointer = Pointer.nativeValue(structs[0].getPointer()); // C pointer address