Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.activeX   Previous This
Package
Next

 


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

Constructors

ActiveXComponent

public ActiveXComponent();

Creates a new ActiveXComponent object.

ActiveXComponent

public ActiveXComponent(String c);

Creates a new ActiveXComponent object whose class is identified by the CLSID or ProgID (programatic identifier).

ParameterDescription
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.

ActiveXComponent

public ActiveXComponent(IUnknown punk);

Creates a new ActiveXComponent object using the identity of a pre-existing COM object.

ParameterDescription
punk The identity of the COM object.

Methods

createInstance

public IUnknown createInstance(String c);

Creates a new instance of the ActiveXComponent class.

Return Value:

Returns the IUnknown interface of the new object.

ParameterDescription
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.

createInstance

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.

createInstance

public void createInstance(IUnknown punk);

Creates a new ActiveXComponent object using the identity of a pre-existing COM object.

Return Value:

No return value.

ParameterDescription
punk The identity of the COM object.

enableEvents

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.

getCLSID

public String getCLSID();

Retrieves the CLSID (or ProgID) of the ActiveXComponent object.

Return Value:

Returns the CLSID (or ProgID) for the component.

getHost

protected IAXComponent getHost();

Retrieves the interface of the ActiveXComponent host.

Return Value:

Returns the interface of the ActiveXComponent host.

getObject

public IUnknown getObject();

Retrieves the IUnknown interface of an ActiveXComponent object.

Return Value:

Returns the IUnknown interface of the ActiveXComponent object.

getProperty

public Variant getProperty(String propertyname);

Invokes a property to retrieve the property value.

Return Value:

Returns the value of the property.

ParameterDescription
propertyname The name of the property whose value will be retrieved.

Exceptions:

IllegalArgumentException if propertyname is null.

invoke

public Variant invoke(String methodname, Variant args[]);

Invokes a method on the ActiveX control.

Return Value:

Returns the value returned by the invoked method.

ParameterDescription
methodname The name of the method to invoke.
args The argument list for the method.

Exceptions:

IllegalArgumentException if methodname is null.

setCLSID

public void setCLSID(String c);

Sets the CLSID or (ProgID) of the ActiveXComponent object.

Return Value:

No return value.

ParameterDescription
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.

setProperty

public void setProperty(String name, Variant value);

Sets a variant property of the ActiveX control.

Return Value:

No return value.

ParameterDescription
name The name of the property to set.
value The value of the property.

Exceptions:

IllegalArgumentException if name is null.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.