Microsoft SDK for Java

invokeSub

The invokesub method of the Dispatch Class contains the following signatures:

invokeSub(Object pDispatch, _Guid iid, String dispName, int dispID, int lcid, int wFlags, Object oArg[], int uArgErr[])
invokeSub(Object pDispatch, String dispName, int wFlags, Object oArg[], int uArgErr[])
invokeSub(Object pDispatch, int dispid, int wFlags, Object oArg[], int uArgErr[])

invokeSub(Object pDispatch, _Guid iid, String dispName, int dispID, int lcid, int wFlags, Object oArg[], int uArgErr[])

Invokes a subroutine or sets a property on an ActiveX Automation object. The difference between this method and invoke is that this method accepts arbitrary objects rather than Variant objects as arguments to the invoked method. This method is very similar to invokev, but it does not accept a return value from the method.

Note   Some language implementations do not invoke subroutines as if they were functions. If the invoked method does not return a value, use invokeSub.

Syntax

public static void invokeSub(Object pDispatch, _Guid iid, String dispName, int dispID, int lcid, int wFlags, Object oArg[], int uArgErr[]);

Parameters

pDispatch The Java proxy of the ActiveX Automation object.
iid The identifier of the interface that is called. If the value is null, the interface identifier defaults to IID_IDispatch.
dispName The name of the method or property that is invoked. If the value is null, dispID is used.
dispID The identifier of the method or property. Unless dispName is null, this parameter is ignored.
lcid The locale ID.
wFlags The type of access, which must be Dispatch.Method, Dispatch.Get, Dispatch.Put, or Dispatch.PutRef.
oArg The arguments of the method or property.
uArgErr An optional one-element array. If an error occurs, uArgErr receives the index of the offending parameter.

invokeSub(Object pDispatch, String dispName, int wFlags, Object oArg[], int uArgErr[])

Invokes a subroutine or sets a property on an ActiveX Automation object. This method is very similar to invokev, but it does not accept a return value from the method. Some language implementations do not invoke subroutines as if they were functions. This method is easier to call than the full invokeSub method and enables you to pass arbitrary objects rather than Variant objects. However, the method does not enable you to specify the interface identifier or the locale, and the method must be identified by name.

Note   If the invoked method does not return a value, use invokeSub to avoid problems.

Syntax

public static void invokeSub(Object pDispatch, String dispName, int wFlags, Object oArg[], int uArgErr[]);

Parameters

pDispatch The Java proxy of the ActiveX Automation object.
dispName The name of the method or property.
wFlags The type of access, which must be Dispatch.Method, Dispatch.Get, Dispatch.Put, or Dispatch.PutRef.
oArg The arguments of the method or property.
uArgErr An optional one-element array. If an error occurs, uArgErr receives the index of the offending parameter.

invokeSub(Object pDispatch, int dispid, int wFlags, Object oArg[], int uArgErr[])

Invokes a subroutine or sets a property on an ActiveX Automation object. This method is very similar to invokev, but it does not accept a return value from the method. Some language implementations do not invoke subroutines as if they were functions. If the method does not return a value, use invokeSub to avoid problems. This method is easier to call than the full invokeSub(Object pDispatch, _Guid iid, String dispName, int dispID, int lcid, int wFlags, Object oArg[], int uArgErr[]) method and enables you to pass arbitrary objects rather than Variant objects. However, the method does not enable you to specify the interface IID or the locale, and the method must be identified by dispid.

Syntax

public static void invokeSub(Object pDispatch, int dispid, int wFlags, Object oArg[], int uArgErr[]);

Parameters

pDispatch The Java proxy of the ActiveX Automation object.
dispid The identifier of the method or property.
wFlags The type of access, which must be Dispatch.Method, Dispatch.Get, Dispatch.Put, or Dispatch.PutRef.
oArg The arguments to the method or property.
uArgErr An optional one-element array. If an error occurs, uArgErr receives the index of the offending parameter.

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