Microsoft SDK for Java

do_execute_java_method

Calls a Java method.

Syntax

long __cdecl do_execute_java_method(ExecEnv *ee, void *obj, char *method_name, char *signature, struct methodblock *mb, bool_t isStaticCall);

Parameters

*ee The placeholder for the execution environment, which is not needed by the Microsoft VM. This parameter should be set to NULL.
*obj The object pointer.
*method_name The name of the method to invoke. Set to NULL if using a method block.
*signature The types of parameters passed to the constructor. See execute_java_dynamic_method for a description of signature characters. Pass NULL if using a method block.
*mb The address of the cached method block data structure. Use get_methodblock to retrieve this. The underlying structure of the method block is not defined; it is used only to prevent accidental type misuse using the alternative, PVOID.
isStaticCall True if calling a static method; otherwise, is false.

Remarks

get_methodblock is a helper function for this function. It can be used when making repeated calls to a method to avoid the overhead of name lookup on each call. Note that invoking a Java method can cause garbage collections.

The following example demonstrates calling this function for repeated access to the Rectangle.move method.

struct {
    Hjava_awt_Rectangle *phRectangle;
} gc;

struct methodblock *pmb = get_methodblock(gc.phRectangle, "move", "(II)V");

for (i=0; i < 10; i++)
{
  do_execute_java_method(NULL, gc.phRectangle, NULL, NULL, pmb, FALSE, x, y);
}

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