An OleControl widget provides an OLE container the place to put OCXs. OLE controls are primitive widgets and, as such, they conform to all standard widget-geometry management. An
OleControl widget contains the connections to an OCX and transparently manages all low-level OLE interaction with that object. In addition, an
OleControl widget provides an OLE automation interface for its contained OCX to be used to set and get OCX properties and to invoke OCX methods.
OleControl widgets are created and managed like other primitive widgets. Unlike
OleClient widgets, however, the only way to create and connect an OCX to an OleControl widget is through its registered name. This is the same as the creation of OLE clients using the
clientName resource, which is based on the OCX's registered programmatic identifier, or
ProgId.
Since OLE controls are also created as child widgets of any non-primitive widget (that is, any CwComposite), there is an additional widget-creation convenience method implemented in
CwWidget, called
createOleControl:argBlock:. The creation block passed to this method must not only specify the
clientName resource (through the
clientName: method) but also the ambient-property handler, or callback, to be used by the contained OCX. This ambient-property handler is specified through the
OleControl instance methods
ambientPropertyReceiver: and
ambientPropertySelector:.
Copyright 2005, 2020 Instantiations, Inc. All rights reserved.