order of arguments while calling a Java method from C

Hi

are there any rules to order the transferred arguments ?

I wanted to transfer a native window event from C to Java and if the called

java method is declared like this: (int, long, int) (IJI)V

public static void nativeMouseButtonDownCallback(int wParam, long lParam, int which)

the value of 'which' is not correct (always the same independent from what I set it to in the C function)

If I declare the java method like this: (int, int, long) (IIJ)V

public static void nativeMouseButtonDownCallback(int which, int wParam, long lParam)

everything is fine.

Any information appreciated !

Bye Mark

[679 byte] By [Mark100] at [2007-9-26 10:57:32]
# 1
The order is specified by the arguments, left to right.I would suspect that you are simply not setting the correct value.
jschell at 2007-7-1 23:43:48 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Thanks for your reply !

Initially I also thought that the set of the value could be wrong and so

I used a printf statement in C to monitor the transferred value.

And still: the value I put in was different from what I got in java.

After this I put in simple numbers like 1,2,3 and in java I still got

the same wrong value.(guess max signed int 21474836..)

I really replaced the dll and class files and restarted the IDE.

The problem got solved by changing the order of the long an int.

Bye Mark

Mark100 at 2007-7-1 23:43:48 > top of Java-index,Java HotSpot Virtual Machine,Specifications...