Appendix B. OLE and ActiveX in SWT/JFace

 

In earlier chapters, we explored how SWT is built in layers: a small library of C code built with Java Native Interface (JNI) interacts with the underlying operating system to provide the necessary building blocks for more elaborate capabilities. One of the design goals of the native layer was for it to be very small, often providing simple wrappers around native APIs. Using this novel approach, the OTI/IBM team has been able to give programmers unprecedented access to the native capabilities of all supported platforms. In so doing, the team chose not limit itself to the features common to all platforms. Among these platforms, Microsoft Windows offers a unique capability that has appealed to Visual Basic programmers for many years: reusable binary objects, otherwise known as COM objects.

SWT/JFace programmers haven’t been left out; this appendix covers the nature and depth of COM support in SWT. Specifically, you’ll see how you can include ActiveX controls and OLE documents inside your applications in just a few SWT method calls. So that you can fully take advantage of this feature, we’ll first review some basic COM features and general principles.

B.1. COM simplified

B.2. The SWT COM library

B.3. Doing COM with SWT