Next Previous Up Top Contents Index

3.5 Building an OLE control in DUIM

3.5.1 Differences from implementing OLE compound document servers

To build an OLE control in DUIM using the DUIM-OLE-Control library, write your application as you would write an OLE compound document server with DUIM-OLE-Server (see Section 3.4), but with the few differences summarized below.

1. Use the library DUIM-OLE-Control instead of DUIM-OLE-Server.
In addition to the DUIM libraries you would normally use, use the DUIM-OLE-Control library and its DUIM-OLE-Control module in your control's library and module definitions.
2. You can optionally provide type information, specifying the methods and properties that are available to your control's clients (control containers). Type information is represented with an instance of <coclass-type-info>. If the frame just contains a DUIM <gadget>, you can let the library create type information automatically. It creates type information corresponding to the DUIM gadget protocols.
3. If possible, define a method for max-storage-size.
4. The program must be linked as a dynamic link library (file suffix .DLL or .OCX), not as an .EXE file.
5. Do not directly instantiate the DUIM frame or call start-frame.
OLE control registration and activation is handled by the initialize-ole-control macro, described below.

An OLE control also differs from a compound document server in that out-of-place activation is never used, and to be actually used as a "control" element, the frame will typically contain just a single <gadget>, with no menu bar or tool bar, so that it can be active at the same time as other controls.

For more information, see the code for the DUIM OCX Scribble example, in

Examples\duim-ole\ocx-scribble\


OLE, COM, ActiveX and DBMS Reference - 31 MAR 2000

Next Previous Up Top Contents Index