On Oct 30, 2007, at 7:09 AM, Michele Croci wrote:
I'm sorry for disturbing you again but I'm still not able to get
the correct data. Can you check if the method declarations in the
Java-interface are correct?
Here the specification of (one part of) the dll:
HCTX WINAPI WTOpenA(HWND hWnd, LPLOGCONTEXTA lpLogCtx, BOOL fEnable)
BOOL WINAPI WTClose(HCTX hCtx)
UINT WINAPI WTInfoA(UINT wCategory, UINT nIndex, LPVOID lpOutput)
int WINAPI WTPacketsGet(HCTX hCtx, int cMaxPkts, LPVOID lpPkts)
Here (one part of) my Java-interface:
public interface Wintab32 extends W32API {
HDC WTOpenA(HWND hwnd, Logcontexta s, boolean b);
As a matter of style, I'd recommend dropping the "A" suffix (assuming
there's a "W" version available) and using the W32API default options
when loading your library.
I'd also recommend naming your structures exactly as they are named
in the C headers (e.g. LOGCONTEXT vs Logcontext).
boolean WTClose(HDC hDC);
int WTInfoA(int category, int index, Logcontexta s);
int WTPacketsGet(HDC hdc, int max, Packet[] p);
}
}
WTOpenA, WTInfoA and WTClose seems to work correctly, but
WTPacketsGet doesn't.
You don't provide the C definition of Packet, nor the Java definition.
* make sure your structures are declared within the library interface
definition
* from http://www.sonycsl.co.jp/projects/ar/restricted/wintabl.html,
I see Packet[] is a block of memory of size "max*sizeof(PACKET)", so
I would guess that your structure definition for PACKET is off.
Given this:
typedef struct tagPACKET {
HCTX pkContext; // Pointer/PointerType
UINT pkStatus; // int
LONG pkTime; // int
WTPKT pkChanged; // int (32-bit field)
UINT pkSerialNumber; // int
UINT pkCursor; // int
DWORD pkButtons; //int
DWORD pkX; //int
DWORD pkY; //int
DWORD pkZ; //int
UINT pkNormalPressure; //int
UINT pkTangentPressure; //int
ORIENTATION pkOrientation; // inline structure { int,int,int }
ROTATION pkRotation; /* 1.1 */ // structure definition missing
} PACKET;
Your docs probably have a complete description of the ROTATION
structure.