Working with MS VM
 
 

Microsoft VM    PreviousVMNext
Invocation Interfaces     Previous VM Next

 


IJavaExecute

// IUnknown methods
HRESULT QueryInterface(REFIID riid, LPVOID *ppv);
ULONG   AddRef();
ULONG   Release();

// IJavaExecute methods
HRESULT GetDefaultClassPath(LPOLESTR *ppszClassPath);
HRESULT Execute(LPJAVAEXECUTEINFO pjei, LPERRORINFO *pperrorinfo);

IJavaExecute::GetDefaultClassPath

HRESULT GetDefaultClassPath(LPOLESTR *ppszClassPath)

Sets ppszClassPath to a string describing the default class path (computed from the registry and the environment).

ParameterDescription
ppszClassPath Address of the buffer to receive the class path. The elements in the class path are separated by semicolons, and elements are searched in the order they appear in the string.

Remarks:

The caller must free the returned string using the CoTaskMemFree function.

IJavaExecute::Execute

HRESULT Execute(LPJAVAEXECUTEINFO pJavaExecuteInfo, LPERRORINFO *ppErrorInfo);

Loads a Java class and executes its static main method.

The main method must have the following signature:

public static void main( String[] )

Return Value:

If the main method runs successfully and does not throw an uncaught Java exception, the Execute method returns S_OK, and ppErrorInfo is set to NULL.

If the main method runs successfully and throws an uncaught Java exception, the Execute method returns S_OK, and ppErrorInfo is set to an IErrorInfo object that describes the exception.

If the class is not found or does not expose a main method, or if there are insufficient resources to run the method, the Execute method returns a failing HRESULT.

ParameterDescription
pJavaExecuteInfo This structure provides the name of the class, the arguments, and the execution environment. See JAVAEXECUTEINFO.
ppErrorInfo Points to a buffer that receives an IErrorInfo interface object if the main method throws a Java exception. This parameter can be NULL if this information is not needed.

Top © 1998 Microsoft Corporation. All rights reserved. Terms of use.