I have a C function (compiled into a DLL) that takes a WinDef.RECT
object and prints out the four co-ordinates:
DllExport void Test(RECT rect)
{
printf("Rect: %i, %i, %i, %i", rect.top, rect.left, rect.bottom, rect.right);
}
On the Java (JNA) side, I'm attempting to pass it a WinDef.RECT
as follows:
WinDef.RECT rect = new WinDef.RECT();
rect.bottom=0;
rect.left=0;
rect.right=0;
rect.top=0;
jna.INSTANCE.Test(rect);
However, I just get nonsense numbers out (which aren't consistent and vary every time), eg:
Rect: -857788769, 11343200, 8044544, 8044544
I'm assuming that I'm not defining the RECT correctly on the JNA side (the C++ function is fine called from other native functions in the same dll), but beyond that I'm a bit stuck!