PreviousPersistence OLE Automation (Windows 95 and Windows NT)Next"

Chapter 34: Using Other Object Domains (32-bit)

Object COBOL enables you to send and receive messages to and from objects, using Object Request Brokers (ORBs). Different operating systems support different ORBs, but the ones supported by Object COBOL include:

Object COBOL provides a separate domain for objects accessed through each ORB, and an Object COBOL program can access objects from several different domains. The objects accessed through a domain can be written in another language, and can be running in a separate process, although this is not always the case.

This support is only available on 32-bit Object COBOL systems.

34.1 Overview

The different types of ORB available through Object COBOL provide different levels of functionality. OLE automation provides support for sending messages, whereas SOM provides messaging support, and enables you to inherit from other SOM objects.

Each ORB is represented by a different domain, and the support for each domain always consists of the following minimum:

Some ORBs provide additional services; these are documented for the specific ORBs.

34.2 Generic Domain Support

The following sections document the parts of domain support that are the same across all ORBs:

34.2.1 Identifying Objects from Different Domains

When you want to access a server object in a different domain, you need to identify the domain where it will be found. You do this through the Class-Control paragraph.

     class is "$domain-name$class-name"

where the parameters are:

domain-name The name of the domain for the object.
class-name The name by which the class is known to the domain. This is usually determined by the name under which the class has been registered with the ORB for that domain.

The example code below identifies two class objects, CharacterArray and Excel. CharacterArray is a native Object COBOL object, Excel is an OLE automation server, identified by $OLE$.

    CharacterArray is class "chararry"
    Excel is class "$OLE$excel.application"

To start using an instance of Excel, you send the OLE automation server the "new" message:

invoke excel "new" returning anExcelServer

This instantiates the OLE automation server; you can now send messages to anExcelServer.

34.2.2 Sending Messages to an Object in a Different Domain

Once you have identified a class as being in a different domain, you can send messages to it using the INVOKE verb. There is no difference in syntax between using INVOKE to communicate with an Object COBOL object, and in communicating with an object running in a different domain.

Not all COBOL datatypes are supported across different domains though, so parameters may be converted to a different format before being sent with the message. Data casting rules are documented separately for each domain.

Particular message selectors may have special meanings to different domains. For example, message selectors prefixed with "get" and "set" are automatically converted to property set or get operations in the OLE domain. The "_get_" and "_set_" prefixes have a similar meaning in the SOM domain. These rules are also documented separately for each domain.

Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousPersistence OLE Automation (Windows 95 and Windows NT)Next"