ActiveX
Description: | Instantiates an ActiveX object. An ActiveX object is treated as a COM client interface that requires a client window area in which to draw. |
Usage: | Steady State only. |
Warning: | This function should be used only by advanced programmers. It may interfere with VTScada graphics. |
Function Groups: | COM |
Related to: | COMClient | COMEvent | COMStatus |
Format: | ActiveX(X0, Y0, X1, Y1, ObjectIdentifier, EventSearchScope[, EventParent, EventCaller, LicenseString]) |
Parameters: |
X0, Y0, X1, Y1 |
Required These are the numeric coordinates of the client window area in which the COM object is to draw itself. |
ObjectIdentifier |
Required. Specifies a unique identifier for the object that is to be instantiated. It may take one of the following forms: • A text string representing a ProgID (e.g. "Excel.Application"). • A textual GUID in registry format (e.g. "{000208-0000-0000-C000-000000000046}"). Note that the curly braces are compulsory. • A binary GUID (e.g. the result from "GetGUID(1, 00020812-0000-0000-C000-000000000046)"). |
EventSearchScope |
Optional. May be any expression that yields a module value or object value. This parameter specifies the scope in which to search for event subroutines. Needed only if you wish to handle events from the COM object. If missing or invalid, the COM events will not be enabled. |
EventParent |
Optional Any expression yielding an object value. If present, specifies the context that is used to resolve scope for event subroutines. May be any expression that yields an object value. Defaults to Self(). |
EventCaller |
Optional. Any expression that yields an object value. If present, this specifies an "auxiliary" context for event subroutines. An event subroutine can retrieve this value using Caller(Self()) Defaults to Self(). |
LicenseString |
Optional. Used to provide a license key that will be passed to the ActiveX control when instantiated, permitting the use of ActiveX controls that require license data for activation. This will work for both server-instantiated ActiveX controls and those that are remotely called by a VIC. |
Comments: |
If the statement succeeds, a COM client interface is returned, allowing subsequent access to the object. If it fails, Invalid is returned. Within an Anywhere Client session, this function does nothing. |
Example:
[ Loaded = 0; BrowserObj; ] BrowserObj = ActiveX(12, 52, w - 22, h - 42, "Shell.Explorer"); If Timeout(Valid(BrowserObj) && !Loaded, 1); [ BrowserObj\Navigate("www.google.com"); Loaded = 1; ]
Example 2:
MyObject = ActiveX(… ); X = MyObject\DoSomething(aValue); { A method call on the object } MyAxObjects\AProperty = "Hello"; { A property set } Y = MyAxObject\AnotherProperty; { A property get }