C:
					
typedef struct Example5Struct {
	int val;
} Example5Struct;
...
void example5_fillStruct(Example5Struct* pval)
{
	pval->val = 32;
}
					
				
Java:
					
public interface CLibrary extends Library {
	public static class Example5Struct extends Structure {
		public static class ByReference extends Example5Struct implements Structure.ByReference {}
		
		public int val;
	}
	...
	public void example5_fillStruct(Example5Struct.ByReference pval);
}
...
CLibrary clib = (CLibrary)Native.loadLibrary("testlib", CLibrary.class);
...
CLibrary.Example5Struct.ByReference e5ref = new CLibrary.Example5Struct.ByReference();
clib.example5_fillStruct(e5ref);
System.out.println("example 5: " + e5ref.val);
//www.sitcoder.com


	
色迷迷 哭 呕吐 大笑 口水 微笑 啵一个 发怒

Hi,您需要填写昵称和邮箱!

  • 必填项
  • 必填项