On Jun 1, 2009, at 8:28 PM, Daniel Noll wrote:
Timothy Wall wrote:
Use Pointer.createConstant() to compare values. BTW, the HWND type
is defined in the W32APIS interface.
The copy of JNA I'm working with doesn't have this class yet... I'm
using the copy included in JRuby.
You can always make your own (the original is in the examples.jar,
which is probably not included with JRuby). It's just a type derived
from PointerType, no special implementation.
In most cases you don't have to "cast" to an int, but if you
really, really want to, you can do
new PointerByReference(ptr).getPointer().getInt(0)
It looks like I will have to use this trick, it works well. Pointer
doesn't have compareTo, so I can't do the logic I need, where >= 32
is success and < 32 is failure. I guess I could switch to the Ex
version of the API as well, but then I would need do define a struct
and more things can go wrong...
yeah, keep it simple. no need to be more complex than necessary.