Class ActiveXComponent
public class ActiveXComponent extends Canvas
{
// Constructors
public ActiveXComponent();
public ActiveXComponent(String c);
public ActiveXComponent(IUnknown punk);
// Methods
public IUnknown createInstance(String c);
public IUnknown createInstance();
public void createInstance(IUnknown punk);
public void enableEvents();
public String getCLSID();
protected IAXComponent getHost();
public IUnknown getObject();
public Variant getProperty(String propertyname);
public Variant invoke(String methodname, Variant args[]);
public void setCLSID(String c);
public void setProperty(String name, Variant value);
}
This class provides basic Microsoft® ActiveX® control functionality. Its methods allow you to create ActiveXComponent objects, to set or retrieve the CLSID (class identifier) that identifies the class of the object, and to get the IUnknown interface of an ActiveXComponent object. The ActiveXControl class extends this class.
Canvas
|
+--ActiveXComponent
public ActiveXComponent();
Creates a new ActiveXComponent object.
public ActiveXComponent(String c);
Creates a new ActiveXComponent object whose class is identified by the CLSID or ProgID (programatic identifier).
Parameter | Description |
c
| The CLSID (or ProgID) of the object that is created. The CLSID must be in the form "{xxx...xxx}", where x represents a numeric character between 0 and 9, inclusive.
|
public ActiveXComponent(IUnknown punk);
Creates a new ActiveXComponent object using the identity of a pre-existing COM object.
Parameter | Description |
punk
| The identity of the COM object.
|
public IUnknown createInstance(String c);
Creates a new instance of the ActiveXComponent class.
Return Value:
Returns the IUnknown interface of the new object.
Parameter | Description |
c
| The CLSID (or ProgID) of the object that is created. The CLSID must be in the form "{xxx...xxx}", where x represents a numeric character between 0 and 9, inclusive.
|
public IUnknown createInstance();
Creates a new ActiveXComponent object with the CLSID that was previously set by the constructor or by the setCLSID method.
Return Value:
Returns the IUnknown interface of the new object.
public void createInstance(IUnknown punk);
Creates a new ActiveXComponent object using the identity of a pre-existing COM object.
Return Value:
No return value.
Parameter | Description |
punk
| The identity of the COM object.
|
public void enableEvents();
Wires events for an object. When an object derives from the ActiveXComponent class, this method should be implemented using an instance of ConnectionPointCookie to sink an event.
Return Value:
No return value.
public String getCLSID();
Retrieves the CLSID (or ProgID) of the ActiveXComponent object.
Return Value:
Returns the CLSID (or ProgID) for the component.
protected IAXComponent getHost();
Retrieves the interface of the ActiveXComponent host.
Return Value:
Returns the interface of the ActiveXComponent host.
public IUnknown getObject();
Retrieves the IUnknown interface of an ActiveXComponent object.
Return Value:
Returns the IUnknown interface of the ActiveXComponent object.
public Variant getProperty(String propertyname);
Invokes a property to retrieve the property value.
Return Value:
Returns the value of the property.
Parameter | Description |
propertyname
| The name of the property whose value will be retrieved.
|
Exceptions:
IllegalArgumentException
if propertyname is null.
public Variant invoke(String methodname, Variant args[]);
Invokes a method on the ActiveX control.
Return Value:
Returns the value returned by the invoked method.
Parameter | Description |
methodname
| The name of the method to invoke.
|
args
| The argument list for the method.
|
Exceptions:
IllegalArgumentException
if methodname is null.
public void setCLSID(String c);
Sets the CLSID or (ProgID) of the ActiveXComponent object.
Return Value:
No return value.
Parameter | Description |
c
| The new CLSID (or ProgID) of the object. The CLSID must be in the form "{xxx...xxx}", where x represents a numeric character between 0 and 9, inclusive.
|
public void setProperty(String name, Variant value);
Sets a variant property of the ActiveX control.
Return Value:
No return value.
Parameter | Description |
name
| The name of the property to set.
|
value
| The value of the property.
|
Exceptions:
IllegalArgumentException
if name is null.