While browsing through the methods available in PowerCOBOL, it is useful to understand a few terms used in Windows-based development.
There are a number of methods that belong to functional groups associated with a specific technology area. In some cases, few if any methods exist for a particular technology area because it is so highly automated.
These include:
ActiveX - This is the latest rendition of Microsoft's OLE technology (discussed below) based upon Microsoft's COM (component object model). You can use PowerCOBOL to build ActiveX controls and components.
When you create an ActiveX component (control) using PowerCOBOL, its properties and methods are exposed to the outside world in a generic way, allowing it to be plugged into another application (which may or may not be written in PowerCOBOL), and manipulated like any other control or subprogram. ActiveX is a very powerful and exciting technology. Using it, you can embed a web browser control directly into your PowerCOBOL application and control it.
Think about how difficult it must be to write your own custom web browser. Using ActiveX, you simply grab the Microsoft Internet Explorer control and drop it onto your PowerCOBOL form. You may then access all of its properties and methods to customize it anyway you desire.
ADO - Active Data Objects - this is Microsoft's data access technology. It provides a more object-oriented way of accessing a variety of database systems in the Windows environment than the more traditional ODBC. PowerCOBOL provides an ADO data control.
DDE - Dynamic Data Exchange (DDE) is a facility that allows a Windows application to request information from another Windows application. DDE can sometimes be thought of as a kind of clipboard between separate applications at run-time.
DDE is a precursor to OLE, and OLE is generally considered to be a superior technology in many cases when compared to DDE. Technically, a DDE conversation takes place between two windows, but in reality most controls qualify as 'windows'. DDE is used when you establish a conversation (sometimes called a link) between two windows. One window becomes the client (the window requesting data), and the other window becomes the server (the window providing the requested data). The client can, however, send data back to the server. Windows will allow an application to engage in multiple DDE conversations at the same time. A single application may function as both a client and a server at the same time. You must know the DDE name of the application you wish to talk to in order to establish a link to it.
Two popular applications that support DDE are Microsoft Word and Excel, whose DDE names are "WinWord" and "Excel", respectively. You additionally need to know the topic of the DDE conversation. This is often simply a filename. Microsoft Excel will use a full path qualified filename ending in an .xls extension as a suitable topic. Lastly, you need to know the item you are talking about. In using Excel as a DDE server, the DDE conversation item would typically be a cell or range of cells. If a PowerCOBOL application is the DDE server, the control name of a static text control, or image control, or a text box control may qualify as an item.
There are typically three types of conversations - hot link, cold link, and notification link. A hot link causes the server to send data contained in the specified item whenever it changes on the server in real time. A cold link means that the client must specifically request updates. A notification link is a conversation in which the DDE server alerts the DDE client that data within a specified item has changed, but the data is only transferred when a LinkRequest is executed.
MCI - Media Control Interface (MCI) is a technology that provides a number of multimedia-oriented controls such as a sound player and recorder, video player, CD player, etc. to your application. You can send commands to these devices to load, play, record, and save multimedia files. There are additional commands available that provide a high level of control over the MCI device being used. Using the PowerCOBOL MCI control, you can build your own CD player in COBOL, complete with buttons to control playing, rewinding and pausing. Sound a bit far fetched? If so, simply look at the PowerCOBOL sample project named CDPLAYER.PPJ found in the MCI subdirectory under the above noted sample programs directory.
ODBC - Open Data Base Connectivity (ODBC) is a technology that provides a common interface into a large number of database and file systems. Many database management systems (DBMS) come with a proprietary application programming interface (API) to program to. Some of these provide a relational SQL API, but there may be slight differences in the SQL usage that affect portability to other DBMS'.
ODBC was developed as a generic API to program to, which also allows the application to dynamically link to a database system using an ODBC source at run-time. This allows applications to easily switch between DBMS' without source code changes, as well not needing to be re-compiled or re-linked.
OLE - Object Linking and Embedding (OLE) began as a technology that complimented and extended dynamic data exchange (DDE). In later times it has been extended far beyond its initial uses.
One of the major differences between OLE and DDE is that in addition to transferring data between applications, OLE allows the data to appear in the same format as it does in the application sending the data. For example an Excel spreadsheet appears as an Excel spreadsheet when embedded in a PowerCOBOL form. You may even have access within the PowerCOBOL to the Excel tool bar and functions to act upon this embedded spreadsheet. Using OLE you are actually embedding a foreign application object directly into your PowerCOBOL application.
Additionally, OLE Automation allows a PowerCOBOL application to take control of another application and drive it. Using OLE automation, you can link to another OLE-enabled application and control its properties and even invoke its methods, thus controlling it completely.