using WORD pointer with Jawin - possible?
Benjamin Sommerfeld <[email protected]>
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <[email protected]> |
Hi altogether,
I'm new to Jawin and want to use it to call some C-Methods.
I already achieved some prosperities with Jawin, but now I have a
problem with the "WORD" type in C.
Here's the method syntax for the method I have problems with:
Syntax : WORD P100X_Polling(word *wAdVal);
Parameter:
wAdVal : [Output] address of wAdVal, which store the AD data
Data is returned as an integer value in the range 0-4095.
I tried to call this method the following way:
....
....
short pollingResult = 0;
FuncPtr polling = new FuncPtr("P100X.DLL", "P100X_Polling");
String result = polling.invoke(pollingResult, ReturnFlags.DONT_CARE);
.....
.....
But when I use a short, my application will crash and it will also crash
if I use int for "pollingResult". When I use String for "pollingResult",
it won't crash but "pollingResult" will always be "0" and that's
impossible, cause this method returns a value >0 if I call it in C.
So the question is now: How can I call this function in Java / what kind
of Java type can I use for this WORD-pointer demanded by "P100X_Polling"?
Thanks in advance, Benjamin