OLE allows client programs to access server programs, enabling integration between a variety of software components. All OLE servers are usable by all OLE clients.
An OCX control, also known as an ActiveX control, or Microsoft Custom Control, is a special form of OLE control. The main difference is that OCX controls cause events, and are in-process server objects (DLL) whereas OLE controls are local-server objects (EXE).
Both OLE and OCX controls are application packages that can be accessed in a simple and consistent way from other Windows applications.
J Win95/NT supports OLE and OCX, enabling J to be used both as a calculation server and as a client for other Windows software such as Visual Basic and Excel. In particular, OLE makes it very easy to add the power of J to other applications.
A key part of OLE is that a server can run in the same task, or as a separate task, or even as a separate task on another network connected machine. A server in the same task is an in-process server, a server in another task on the same machine is a local server, and a server on another machine is a remote server. An in-process server is the most efficient; the task can call the in-process server's routines almost as efficiently as its own routines.
Servers provide functions, called methods, that can be accessed by a client. For example, the J server provides a method
Do which executes a J sentence; and a method Get which retrieves the value of a variable. If a client runs the method
Do'x=. 3+5', this causes the sentence to be executed in the J server. The client can then call method
Get to retrieve the value of
OLE Automation is an interface supported by many clients and servers. OLE Automation gives a client an interface to a server that mimics the server's end-user interface. This allows a client to automate what would otherwise have to be done manually by a user. Although this is useful, the real power comes when the server has a general purpose programming environment that can be used to build complex services that can be used from a client. OLE Automation then provides easy access from the client to the full power of the server.
J supports OLE Automation as follows:
J OLE Automation server. There are two servers:
J OLE Automation client. This supports servers such as Excel, that provide an OLE Automation interface to an application object that supports macro execution.