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, safeRelease
debug, getBuildDate, getBuildVersion, isDebugEnabled
public 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
- public ActiveXComponent(Dispatch dispatchToBeWrapped)
dispatchToBeWrapped
- public 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
- public 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
- protected void finalize()
finalize
in class Dispatch
Dispatch.finalize()
public Variant getProperty(java.lang.String propertyName)
propertyName
- public ActiveXComponent getPropertyAsComponent(java.lang.String propertyName)
propertyName
- public boolean getPropertyAsBoolean(java.lang.String propertyName)
propertyName
- property we are looking uppublic byte getPropertyAsByte(java.lang.String propertyName)
propertyName
- property we are looking uppublic java.lang.String getPropertyAsString(java.lang.String propertyName)
propertyName
- public int getPropertyAsInt(java.lang.String propertyName)
propertyName
- public 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
- propertyValue
- public void setProperty(java.lang.String propertyName, boolean propValue)
propertyName
- propValue
- the boolean value we want the prop set topublic void setProperty(java.lang.String propertyName, byte propValue)
propertyName
- propValue
- the boolean value we want the prop set topublic void setProperty(java.lang.String propertyName, int propValue)
propertyName
- propValue
- 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
- public ActiveXComponent invokeGetComponent(java.lang.String callAction, Variant... parameters)
callAction
- parameters
- public Variant invoke(java.lang.String actionCommand, java.lang.String parameter)
actionCommand
- parameter
- public Variant invoke(java.lang.String actionCommand, boolean parameter)
actionCommand
- parameter
- public Variant invoke(java.lang.String actionCommand, int parameter)
actionCommand
- parameter
- public Variant invoke(java.lang.String actionCommand, java.lang.String parameter1, int parameter2)
actionCommand
- parameter1
- parameter2
- public Variant invoke(java.lang.String actionCommand, int parameter1, int parameter2)
actionCommand
- parameter1
- parameter2
- public Variant invoke(java.lang.String callAction)
callAction
- http://jacob-project.sourceforge.net