Method ActiveXObject():create() Foundation

Creates an ActiveXObject and connects it to a COM/ActiveX object.

Syntax
:create( <cProgID> | <cCLSID> | <nInterface>, [<cServerName>], ;
        [<cLicense>] ) --> oActiveXObject | NIL
Parameters
<cProgID>
<cProgID> is the ProgID identifying the ActiveX object to be created.
A ProgID has the following syntax:
ApplicationName.ObjectName.Version 
Thereby specification of (.Version) is optional. It defaults to the highest version number installed on the system if omitted.
The ProgIDs of the COM/ActiveX components installed on a computer are listed in the registry at the key HKEY_CLASSES_ROOT.
<cCLSID>
<cCLSID> is the class ID that can be used as an alternative to <cProgID>. Class IDs are stored in the registry as subkeys of a ProgID.
<nInterface>
<nInterface> is the numeric value of a COM interface. This parameter allows the creation of ActiveXObjects with interface pointers obtained from Operating System API calls or modules developed with system languages like C/C++.
<cServerName>
By default, the COM/ActiveX component is created on the machine where the application runs. If a server name is passed in <cServerName>, the COM/ActiveX component is created on the remote machine named cServerName instead. Access to methods and/or properties will be automatically routed to the remote COM/ActiveX component.
If <cServerName> is passed, care must be taken regarding access rights. The method :create() will fail if the required access rights are not granted by the remote computer.
<cLicense>
Some COM/ActiveX components require a license key for being created. If a license key is required, it should be specified in the documentation that accompanies the COM/ActiveX component.
If a license key is required to create a COM/ActiveX component, <cLicense> becomes a mandatory parameter. The method :create()will fail if the license key is omitted or if it is incorrect.
Return

This method returns an object of the class ActiveXObject that is connected to the COM/ActiveX component. If the method fails the value NIL is returned. The error number and a descriptive error message can be retrieved by calling the functions ComLastError()or ComLastMessage().

Description

The ActiveXObject instance returned by the method :create() is connected to the COM/ActiveX component specified in the method's parameters. The ActiveXObject instance serves as a proxy that allows the Xbase++ application to call methods or to access properties of the COM/ActiveX component.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.