COM/MTS Guide |
Panther's COM support lets you:
The Panther editor makes it easy to create COM components by building the necessary files and interfaces from your method and property definitions.
What is COM and DCOM? |
COM (Component Object Model) is Microsoft's framework for building modular software components. COM allows software components to communicate with each other and provides the following advantages:
DCOM (Distributed COM) allows you to call COM components installed on another network machine. Since the location of the COM component is determined by the system registry, not in the COM component itself, you can develop COM components without needing to know where the components will be deployed.
What is MTS? |
MTS (Microsoft Transaction Server) provides transaction support for COM components. In a database application, you often need to make a group of changes to the database at the same time. For example, in a banking application, if you transfer money from one account to another, the amount must be debited from one account and credited to the other account as a single operation. This is called a transaction. If both changes occur successfully, the transaction can be committed, or saved, to the database. If one or both of the changes fail, the transaction needs to be rolled back.
MTS allows you to set properties on each component to ensure that the component is running inside a transaction. In addition, MTS provides support for:
COM Features |
When you create a COM component, Panther automatically assigns it a CLSID
(class identifier) based on your network card ID, the current time, and other data. (Another term for CLSID
is GUID
—globally unique identifier.) When a COM component is registered on your machine, its CLSID
is written into the system registry.
In addition to identifying the COM component, the CLSID
has another use. Whenever you modify a component's interface, you should assign the component a new CLSID
. This guarantees the behavior of COM components. If you find COM components with the same CLSID
, you then know that both components have the same interfaces, properties, and methods.
When you create a COM component, you define the interfaces that the component will support. An interface is a collection of:
All COM components support the IUnknown interface; one of the methods in the IUnknown interface, QueryInterface, allows you to ask the COM component which other interfaces it supports. Since COM components are encapsulated, not allowing access to their internal implementation, interfaces are the only way to access a COM component.
Panther-built COM components support IDispatch, the "automation" interface, to allow easy access by scripting languages (JPL, VBScript, JavaScript) and expose a dual interface (for early or late binding). For more information about defining the component's interface in the Panther editor, refer to "Defining the Component's Interface."
Once a COM component is built, you need to access it from your client application. Panther provides support for accessing COM components via C, JPL, and Java.
For more information about accessing COM components from a client, refer to Chapter 4, "Building Client Screens."
You can install your COM components on each application client or use DCOM or MTS to access COM components on remote machines.
For more information about deploying COM components, refer to Chapter 5, "Deploying COM Components."
Client Access
Deployment Options
COM/MTS Applications |
A Panther application using COM or MTS typically consists of:
The following chapters describe: