开发者

JNA set pointer to Boolean

开发者 https://www.devze.com 2023-03-25 01:00 出处:网络
How is possible to set a pointer to a boolean value? For long I use: Pointer pointer = new Memory (size);

How is possible to set a pointer to a boolean value? For long I use:

Pointer pointer = new Memory (size);
pointer.setLong(0, longValue);

pointer.setBoolean(...) is not defined, so for boolean I tray to use 开发者_StackOverflow社区a setInt but not wrok.


Use IntByReference .

  IntByReference ref = new IntByReference();
   /*Pass ref as argument to some function*/
  if(ref.getValue() == 0)
     ...
  else
     ...
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号