public class ActiveXComponent extends Dispatch
It is really up to the developer as to whether they want to use the Dispatch interface or the ActiveXComponent interface.
This class simulates com.ms.activeX.ActiveXComponent only in the sense that it is used for creating Dispatch objects
| Modifier and Type | Field and Description |
|---|---|
static boolean |
shouldLogEvents
This boolean determines if callback events should be logged
|
fdexNameCaseSensitive, Get, LOCALE_SYSTEM_DEFAULT, m_pDispatch, Method, Put, PutRef| Constructor and Description |
|---|
ActiveXComponent(Dispatch dispatchToBeWrapped)
Creates an active X component that is built on top of the COM pointers
held in the passed in dispatch.
|
ActiveXComponent(java.lang.String programId)
Normally used to create a new connection to a microsoft application.
|
| Modifier and Type | Method and Description |
|---|---|
static ActiveXComponent |
connectToActiveInstance(java.lang.String pRequestedProgramId)
Most code should use the standard ActiveXComponent(String) constructor
and not this factory method.
|
static ActiveXComponent |
createNewInstance(java.lang.String pRequestedProgramId)
Most code should use the standard ActiveXComponent(String) contructor and
not this factory method.
|
protected void |
finalize() |
Dispatch |
getObject()
Probably was a cover for something else in the past.
|
Variant |
getProperty(java.lang.String propertyName)
retrieves a property and returns it as a Variant
|
boolean |
getPropertyAsBoolean(java.lang.String propertyName)
retrieves a property and returns it as a Boolean
|
byte |
getPropertyAsByte(java.lang.String propertyName)
retrieves a property and returns it as a byte
|
ActiveXComponent |
getPropertyAsComponent(java.lang.String propertyName)
retrieves a property and returns it as an ActiveX component
|
int |
getPropertyAsInt(java.lang.String propertyName)
retrieves a property and returns it as a int
|
java.lang.String |
getPropertyAsString(java.lang.String propertyName)
retrieves a property and returns it as a String
|
Variant |
invoke(java.lang.String callAction)
makes a dispatch call for the passed in action and no parameter
|
Variant |
invoke(java.lang.String actionCommand,
boolean parameter)
makes a dispatch call to the passed in action with a single boolean
parameter
|
Variant |
invoke(java.lang.String actionCommand,
int parameter)
makes a dispatch call to the passed in action with a single int parameter
|
Variant |
invoke(java.lang.String actionCommand,
int parameter1,
int parameter2)
makes a dispatch call to the passed in action with two integer parameters
(this was put in for some application)
|
Variant |
invoke(java.lang.String actionCommand,
java.lang.String parameter)
invokes a single parameter call on this dispatch that returns no value
|
Variant |
invoke(java.lang.String actionCommand,
java.lang.String parameter1,
int parameter2)
makes a dispatch call to the passed in action with a string and integer
parameter (this was put in for some application)
|
Variant |
invoke(java.lang.String name,
Variant... args)
This is really a cover for call(String,Variant[]) that should be
eliminated call with a variable number of args mainly used for quit.
|
ActiveXComponent |
invokeGetComponent(java.lang.String callAction)
makes a dispatch call for the passed in action and no parameter
|
ActiveXComponent |
invokeGetComponent(java.lang.String callAction,
Variant... parameters)
makes a dispatch call for the passed in action and single parameter
|
void |
logCallbackEvent(java.lang.String description,
Variant[] args)
used by the doc and application listeners to get intelligent logging
|
void |
setProperty(java.lang.String propertyName,
boolean propValue)
sets a property as a boolean value
|
void |
setProperty(java.lang.String propertyName,
byte propValue)
sets a property as a boolean value
|
void |
setProperty(java.lang.String propertyName,
Dispatch arg)
sets a property on this object
|
void |
setProperty(java.lang.String propertyName,
int propValue)
sets the property as an int value
|
void |
setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
sets a property to be the value of the string
|
void |
setProperty(java.lang.String propertyName,
Variant arg)
sets a property on this object
|
call, call, call, call, callN_CaseSensitive, callN, callN, callSub, callSub, callSub, callSub, callSubN, callSubN, coCreateInstance, get_CaseSensitive, get, get, getActiveInstance, getIDOfName, getIDsOfNames, getIDsOfNames, getProgramId, hasExited, hasExited, invoke, invoke, invoke, invokeSub, invokeSub, invokeSub, invokeSubv, invokeSubv, invokeSubv, invokev, invokev, invokev, invokev, isAttached, put_Casesensitive, put, put, putRef, putRef, QueryInterface, safeReleasedebug, getBuildDate, getBuildVersion, isDebugEnabledpublic static boolean shouldLogEvents
public ActiveXComponent(java.lang.String programId)
This constructor causes a new Windows object of the requested type to be created. The windows CoCreate() function gets called to create the underlying windows object.
new ActiveXComponent("ScriptControl");
programId - the registry identifer for the targetpublic ActiveXComponent(Dispatch dispatchToBeWrapped)
dispatchToBeWrapped - - can wrap an ActiveXComponent around a dispatchpublic Dispatch getObject()
public static ActiveXComponent createNewInstance(java.lang.String pRequestedProgramId)
Factory that returns a Dispatch object wrapped around the result of a CoCreate() call. This differs from the standard constructor in that it throws no exceptions and returns null on failure.
This will fail for any prog id with a ":" in it.
pRequestedProgramId - the program id from the registrypublic static ActiveXComponent connectToActiveInstance(java.lang.String pRequestedProgramId)
Factory that returns a Dispatch wrapped around the result of a getActiveObject() call. This differs from the standard constructor in that it throws no exceptions and returns null on failure.
This will fail for any prog id with a ":" in it
pRequestedProgramId - the regsistry program idprotected void finalize()
finalize in class DispatchDispatch.finalize()public Variant getProperty(java.lang.String propertyName)
propertyName - the property namepublic ActiveXComponent getPropertyAsComponent(java.lang.String propertyName)
propertyName - the property namepublic boolean getPropertyAsBoolean(java.lang.String propertyName)
propertyName - the property name
property we are looking uppublic byte getPropertyAsByte(java.lang.String propertyName)
propertyName - the property name
property we are looking uppublic java.lang.String getPropertyAsString(java.lang.String propertyName)
propertyName - the property namepublic int getPropertyAsInt(java.lang.String propertyName)
propertyName - the property namepublic void setProperty(java.lang.String propertyName,
Variant arg)
propertyName - property namearg - variant value to be setpublic void setProperty(java.lang.String propertyName,
Dispatch arg)
propertyName - property namearg - variant value to be setpublic void setProperty(java.lang.String propertyName,
java.lang.String propertyValue)
propertyName - the property namepropertyValue - the new valuepublic void setProperty(java.lang.String propertyName,
boolean propValue)
propertyName - the property namepropValue - the boolean value we want the prop set topublic void setProperty(java.lang.String propertyName,
byte propValue)
propertyName - the property valuepropValue - the boolean value we want the prop set topublic void setProperty(java.lang.String propertyName,
int propValue)
propertyName - the property namepropValue - the int value we want the prop to be set to.public void logCallbackEvent(java.lang.String description,
Variant[] args)
description - event descriptionargs - args passed in (variants)public ActiveXComponent invokeGetComponent(java.lang.String callAction)
callAction - the action to be calledpublic ActiveXComponent invokeGetComponent(java.lang.String callAction, Variant... parameters)
callAction - the action to be passed inparameters - this looks plural..public Variant invoke(java.lang.String actionCommand, java.lang.String parameter)
actionCommand - the call nameparameter - the String parameterpublic Variant invoke(java.lang.String actionCommand, boolean parameter)
actionCommand - the call nameparameter - the boolean parameterpublic Variant invoke(java.lang.String actionCommand, int parameter)
actionCommand - the commandparameter - the int parameterpublic Variant invoke(java.lang.String actionCommand, java.lang.String parameter1, int parameter2)
actionCommand - command that requires a string and int vlauesparameter1 - the string parameterparameter2 - the int parameterpublic Variant invoke(java.lang.String actionCommand, int parameter1, int parameter2)
actionCommand - the action that accepts 2 int parmaetersparameter1 - first of two int parametersparameter2 - the second of two int parameterspublic Variant invoke(java.lang.String callAction)
callAction - action name that requires zero parameterspublic Variant invoke(java.lang.String name, Variant... args)
name - the name we are invokingargs - a single arghttp://jacob-project.sourceforge.net