Microsoft SDK for Java

execute_java_dynamic_method

Invokes a Java dynamic method.

Syntax

long __cdecl execute_java_dynamic_method(ExecEnv *ee, HObject *obj, char *method_name, char *signature);

Parameters

*ee The placeholder for the execution environment, which is not needed by the Microsoft VM. Set this parameter to NULL.
*obj The address to the Java object containing the method.
*method_name The name of the method to be called.
*signature The types of parameters and return type of the method (see the following table).

Remarks

The signature parameter specifies the parameters and return type of the method by enclosing the character codes for parameter types in parentheses, followed by the character code for the return type. The following table shows the mapping of types to signature characters:

Character Java type
[ array
Z boolean
B byte
C char
D double
F float
I int
J long
L object
S short
V void

Arrays must be followed by the array type; for example, [C for a character array. For multidimensional arrays, repeat [ for the number of dimensions. For example, [[Z signifies a two-dimensional Boolean array.

For objects, the signature is followed by the object class name and ends with a semicolon (;). For example, the signature for the a Rectangle object is "Ljava/awt/Rectangle;".

The following example uses this function to call the Rectangle.move method with two integer parameters to the method, x and y:

long lrval = execute_java_dynamic_method(NULL, phRectangle, "move","(II)V", x, y);

© 1999 Microsoft Corporation. All rights reserved. Terms of use.