(class)
ActiveXObject allows access to COM and ActiveX objects.
Notes
The
ActiveXObject allows you to instantiate ActiveX objects and use their methods and fields. If an ActiveX control has a visual display, it can be placed in a Curl page using
ActiveXGraphic.
ActiveXObject is only available on the Microsoft Windows™ version of the Curl runtime.
| default: | This is used to get an interface to a Microsoft COM object. |
| com-clsid: | Provides the CLSID string corresponding to the underlying COM object. |
accessor public abstract ActiveXObject.com-clsid:#
String
| com-identity: | Provides unique identity of the underlying COM object. |
accessor public abstract ActiveXObject.com-identity:
int64
| event-count: | Returns the number of different events supported by this ActiveX object. |
accessor public abstract ActiveXObject.event-count:
int
| getter-count: | Returns the number of getters available on this ActiveX object. |
accessor public abstract ActiveXObject.getter-count:
int
| method-count: | Returns the number of methods available on this ActiveX object. |
accessor public abstract ActiveXObject.method-count:
int
accessor public final ActiveXObject.object-destroyed?:
bool
| setter-count: | Returns the number of setters available on this ActiveX object. |
accessor public abstract ActiveXObject.setter-count:
int
| public sealed | {ActiveXObject.destroy-object}:void |
| public abstract sealed | {ActiveXObject.get-property}:any |
| set-event-handler: | Allows to specify a Curl procedure to act as an event handler for a COM event. |
| public abstract | {ActiveXObject.set-event-handler}:void |
| public abstract sealed | {ActiveXObject.set-property}:void |
(factory)
This is used to get an interface to a Microsoft COM object.
initial-url: Local file
Url to tell COM object to load on start up.
initial-read-only?: Should initial-url be loaded read-only.
Notes
This is most often used for getting an interface to a Microsoft ActiveX control or to an Automation server.
Only privileged applets can call this factory.
(accessor)
accessor public abstract ActiveXObject.com-clsid:#
String Provides the CLSID string corresponding to the underlying COM object.
Description
Not all COM objects have a CLSID available. A valid CLSID string is returned if the object was created using ClsId or ProgId keyword arguments to
ActiveXObject.default#factory or if the underlying COM object supports the IProvideClassInfo interface. Otherwise the return value is null.
Introduced in:
version 7.0
(accessor)
accessor public abstract ActiveXObject.com-identity:
int64 Provides unique identity of the underlying COM object.
Description
Two
ActiveXObject objects represent two interfaces of the same COM object if and only if their
ActiveXObject.com-identity values are the same. This property can be used for comparisons or hashing.
(accessor)
accessor public abstract ActiveXObject.event-count:
int Returns the number of different events supported by this ActiveX object.
Notes
Introduced in:
version 6.0
(accessor)
accessor public abstract ActiveXObject.getter-count:
int Returns the number of getters available on this ActiveX object.
Notes
(accessor)
accessor public abstract ActiveXObject.method-count:
int Returns the number of methods available on this ActiveX object.
Notes
Example
The following piece of code creates an
ActiveXObject that refers to the Internet Explorer ActiveX control. It creates this ActiveX object and then queries the number of methods available. This example applet requires privilege, it only works on Microsoft Windows™ platforms, and Microsoft Internet Explorer™ must be installed.
{curl 8.0 applet}
{import * from CURL.GRAPHICS.ACTIVEX}
{let active-x-control:ActiveXObject =
{ActiveXObject.create ProgId = "Shell.Explorer"}
}
{value active-x-control.method-count}
(accessor)
accessor public final ActiveXObject.object-destroyed?:
bool Returns true if this ActiveXObject has already been destroyed.
Notes
(accessor)
accessor public abstract ActiveXObject.setter-count:
int Returns the number of setters available on this ActiveX object.
Notes
(method)
| public sealed | {ActiveXObject.destroy-object}:void |
Destroy the ActiveXObject and release the associated ActiveX control.
Notes
It is illegal to call this method more than once on an
ActiveXObject.
If you have passed this
ActiveXObject to an
ActiveXGraphic, then you should not use
ActiveXObject.destroy-object, instead use
ActiveXGraphic.destroy-object.
(method)
Allows enumerating the events of this ActiveX object.
index: The index of the event for which information is to be retrieved. Legal values of
index are from zero to the number returned by
ActiveXObject.event-count - 1.
Introduced in:
version 6.0
(method)
Allows enumerating the getters of this ActiveX object.
index: The index of the getter for which information is to be retrieved. Legal values of
index are from zero to the number returned by
ActiveXObject.getter-count - 1.
(method)
Allows enumerating the methods of this ActiveX object.
index: The index of the method for which information is to be retrieved. Legal values of
index are from zero to the number returned by
ActiveXObject.method-count - 1.
Notes
Client code can request information about each method on the ActiveX control using ActiveXObject.get-method-info.
Example
This code example retrieves the
ActiveXMethodInfo for each method on the ActiveX control, and it places the name of the method in a VBox. This sample applet requires privilege, it will only run on Microsoft Windows™ platforms, and Microsoft Internet Explorer™ must be installed.
{curl 8.0 applet}
{import * from CURL.GRAPHICS.ACTIVEX}
{value
let active-x-object:ActiveXObject =
{ActiveXObject.create ProgId = "Shell.Explorer"}
let num-methods:int = active-x-object.method-count
let vbox:VBox = {VBox}
{for i:int = 0 below num-methods do
let method-info:ActiveXMethodInfo =
{active-x-object.get-method-info i}
{if-non-null name = method-info.name then
{vbox.add name}
else
{vbox.add {format "Couldn't get method-name for %d", i}}
}
}
vbox
}
(method)
| public abstract sealed | {ActiveXObject.get-property}:any |
Get the value of a COM property.
Description
Retrieves the value of the property named name. If additional arguments are specified, they are passed as arguments to parameterized properties.
Introduced in:
version 6.0
(method)
Allows enumerating the setters of this ActiveX object.
index: The index of the setter for which information is to be retrieved. Legal values of
index are from zero to the number returned by
ActiveXObject.setter-count - 1.
(method)
| public abstract | {ActiveXObject.set-event-handler}:void |
Allows to specify a Curl procedure to act as an event handler for a COM event.
name: The name of the event.
handler: The event handler procedure. Its signature must correspond to the event signature in the object's type library. Set it to null to remove an existing event handler.
error-if-missing?: If set to false prevents the exception being thrown if the COM object does not support the named event or (in case of null handler) the requested event handler was not previously specified.
Notes
Whenever an
ActiveXObject has an active event handler, it and the associated COM object cannot be garbage collected. You should call
ActiveXObject.destroy-object or remove all event handlers if you want the object's resources to be reclaimed.
The Curl RTE processes ActiveX events during blocking HTTP calls, so event handlers on an ActiveX object must not enter any sort of event loop or do blocking HTTP calls.
Introduced in:
version 6.0
(method)
| public abstract sealed | {ActiveXObject.set-property}:void |
Set a COM property.
Description
Sets the value of the property named name to value. If additional arguments are specified, they are passed as arguments to parameterized properties.
Notes
The parameterized properties arguments are specified after the value.
Introduced in:
version 6.0