Configuring Uniface for COM Support
The Uniface COM connector allows ProcScript to call out to COM objects, and COM clients to call in to Uniface components, without either side of the conversation knowing the implementation details.
-
Specify the default path for the COM connector as:
[Paths] $COM=COM:
This causes all references to $COM to be routed to a default COM: connection, which uses the current user’s Microsoft Windows security logon and related data for all COM access.
The COM specification supports additional modifiers and has the following format:
[Paths]
$
Path{=
}COM:
{Server}|
{User}|
{Password}- Path—name of a default path (for example,
$SRU
) or a user : defined path (for example,$COMPATH)
COM:
—three-letter Uniface mnemonic for the COM connector- Server—network node or server name
- User—logon name for the user. This must include the domain
name. For example,
lab\emma
means domainlab
, useremma
, for Microsoft Windows domain : based users - Password—password for the user
If Server, User, or Password is a question mark (?), then the standard Uniface logon prompt appears when the path is first opened.
The following example shows how to set the Server (
cz444
), User (lab\emma
), and Password (secret
) for a COM object in an assignment file:$SVC=COM:CZ444|lab\emma|secret
- Path—name of a default path (for example,
-
Assign components to a COM path with an assignment file entry, in the following
way:
[SERVICES_EXEC] component1 = $SVC:component1 Properties
Properties is a list of key-value pairs, as in a Uniface ValRep list, but separated by ASCII semicolons (
;
). This list is passed to the connector. If there is already information available from the Signature Editor, this list is prefixed to the Repository list.Note: There must be a space before the Properties list, to distinguish it from the replacement 4GL service name, or
component1
in the above example.The following are the keys for the property list:
CLASS
—CLSID or ProgID of the desired COM class. This value overrides all other COM class specifications in the Repository and the assignment file.CONTEXT
—determines where the COM object is run. It can be set to one of the following values:LOCAL
—run the object in a separate process on the same computerINPROC
—run the object in the same process space as the COM clientREMOTE
—run the object on a remote workstation
PASSWORD
—passwordSERVER
—network workstation name at which the object should be createdUSER
—user name for the creation context. For a Microsoft Windows domain based login ID, you need to also specify the domain, for example,USER=lab\eddieg
.
For the COM connector, the user can specify the COM ProgID or ClassID of the desired COM class. For example, to specify the ProgID
Excel.Sheet
:[SERVICES_EXEC] SVC1 = $COM:SVC1 CLASS=Excel.Sheet
In the previous example, an instance of the ProgID
Excel.Sheet
COM class is created for each new instance of the SVC1 service.The following example shows how to specify the class with a ClassID value:
[SERVICES_EXEC] SVC1 = $COM:SVC1 CLASS={E7F886B89 : 6331 : 11D2 : 9825 : 006097FEA80D}
If the ClassID is used, it should be enclosed in braces (
{}
).Note: You can also set these values in the property list of a newinstance statement or in the Signature Editor.