JView Sample

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

Note   To use this sample, 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 JView.exe creates an instance of the Microsoft virtual machine (Microsoft VM), uses command-line parameters, and starts the specified Java application. The C code included here uses the exposed Microsoft VM Raw Native Interface (RNI) to create a new instance of the Microsoft VM.

Using the Sample

To compile the sample

Use one of the following commands to build an executable:

For building Jview.exe

nmake CFG="JView"

For building WJView.exe

nmake CFG="WJView"

For building AppletViewer.exe

nmake CFG="AppletViewer"

For building PJView.exe

nmake CFG="PJView"

For building PWJView.exe

nmake CFG="PWJView"

Information on Jview.exe, WJView.exe and AppletViewer.exe can be found in the SDK for Java documentation.  PJView.exe and PWJView.exe are used in Samples\Profiler\Jviewprf.

To run the sample

From the \Samples\Native\JView directory the following can be run:

Jview - run the compiled JView.exe application, specifying a Java application class name as a parameter.

WJView - run the compiled WJView.exe application, specifying a Java application class name as a parameter.

AppletViewer - run the compiled AppletViewer.exe application, specifying a HTML file or URL as a parameter.

PJView - run the compiled PJView.exe application, specifying a Java application class name as a parameter.

PWJView - run the compiled PWJView.exe application, specifying a Java application class name as a parameter.

Key Project Files

javaprop.cpp

This file implements the CEnumResourceJAVAPROPERTY class that parses the command-line parameters. This is essentially a property enumeration interface suitable for use with IJavaExecute2::SetSystemProperties in Jview.cpp.

javaprop.hpp

This file contains the CEnumJAVAPROPERTY class definition.

jview.cpp

This file is the jview front end, including the command-line parsing logic.

jview.h

This file contains the header information for the Jview.cpp code.

makefile

This makefile builds the jview stub.

Jview.rc

This file contains the resources for the executable, such as the version name, and Help information.

resource.h

This standard header file for resources contains flag information.

Technologies Demonstrated

Native Code

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