DLL中的被调函数有两个参数,第二个参数是int64类型的引用类型,因此创建8byte的MemoryBlock;

JNative n = null;
  try {
   n = new JNative("AAAA.dll", "sss");
   n.setRetVal(Type.VOID);
   int i = 0;
   n.setParameter(i++, Type.INT, level);
   Pointer pp = new Pointer(MemoryBlockFactory.createMemoryBlock(8));
   n.setParameter(i++, pp);
   System.out.println(pp.getAsLong(0));
   n.invoke();
   System.out.println(pp.getAsLong(0));
   return 0;
  } finally {
   if (n != null)
    JNative.unLoadLibrary("GeoSOT32.dll");
  }

相关文章:

  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2021-05-25
  • 2021-05-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2021-10-26
  • 2021-05-31
相关资源
相似解决方案