Mastering PowerBuilder

HomePrevious Lesson: Inserting an OCX Control
Next Lesson: OLE Objects

OLE 2.0 Automation

Up until now, you have been learning about the activation of an OLE 2.0 server from a PowerBuilder application and how the user can interact with the server application. However, OLE 2.0 allows you to do much more than simply activating the server application.

OLE Automation is a Windows protocol intended to replace DDE. As with DDE, an application can use OLE Automation to share data or control another application. Once the server is active, you can use a command set provided by the server to manipulate the object, a task that you can perform behind the scenes, out of the user's sight.

This technology is especially useful if you need to use features of one application in another. With OLE Automation, you can integrate features from both applications in a single procedure. For example, a PowerBuilder application can use Microsoft Excel as a financial calculation engine.

Whenever the PowerBuilder application needs to have a financial calculation performed, it can simply call one of Excel's functions, passing the data to be calculated as parameters. Excel performs the calculation and returns the results to the PowerBuilder application. In this way, applications can greatly extend their capabilities by transparently using the functions of other applications.
HomePrevious Lesson: Inserting an OCX Control
Next Lesson: OLE Objects