Invocation Sample

This sample is located in \Samples\Native\Invocation.

Note   It is recommended that you have Microsoft® Visual C++® version 5.0 or higher installed.

Description
Using the Sample
Key Project Files
Technologies Demonstrated

Description

This sample shows how to use the PrepareThreadForJava and UnprepareThreadForJava invocation APIs.

Using the Sample

To compile the sample

Use Nmake.exe to compile the makefile in the \Samples\Native\Invocation directory. Type the following command:

Nmake

The makefile builds the C application and compiles the Java class.

To run the sample

Use the Invokevm.exe application to run the sample. When you run the sample, the Java class, TestClass, writes text to the standard output.

Key Project Files

invokevm.c

This file is a simple C application that uses the Microsoft virtual machine's Raw Native Interface (RNI) functionality to invoke an arbitrary method in the sample Java object, TestClass.

TestClass.java

This small Java class contains a single method that prints to standard output for demonstration purposes.

Technologies Demonstrated

RNI

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