All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

NextPrevUpTopContentsIndex

ole-control-pane

Class
Summary

A class that implements embedding of external components on Microsoft Windows.

Package

capi

Superclasses

pinboard-layout

Initargs

:component-name

A string or nil.

:user-component

A COM interface pointer or nil.

:save-name

A string.

:insert-callback

A function.

:close-callback

A function.

:sinks

A list of sink specifications.

Description

The class ole-control-pane is used to implement embedding of external components.

Note: ole-control-pane is implemented only in LispWorks for Windows. Load the functionality by (require "embed").

Note: even though it is a subclass of pinboard-layout, normally you should not use the pinboard-layout functionality when using ole-control-pane.

component-name (if non-nil) specifies the component-name of the pane, as used by component-name.

user-component (if non-nil) is a COM interface pointer of an object that supports the I-OLE-OBJECT interface, and is ready to display as described in ole-control-user-component.

save-name is used when creating the IStorage object for this component.

insert-callback (if non-nil) is a function that takes a single argument, the pane. It is called immediately after a component was inserted into the pane. This can be used for any additional initialization that is required, for example setting the properties of the control.

close-callback (if non-nil) is a function that takes a single argument, the pane. It is called just before the component is going to be closed, and can be used to do any cleanups that may be required.

sinks is a list of sink specifications for attaching event handlers to the source interfaces of the control. Each element of sinks should be a list of the form:

( interface-name &key invoke-callback sink-class sink )

The interface-name is used to specify the name of the source interface in the control, which is either a string naming the interface or :default for the default source interface. If invoke-callback is given, then it should be a function which will be called with the pane, method-name, method-kind and arguments vector for each source event. The sink-class can be given to set the class of the internal object used for the sink interface. This is similar to calling attach-simple-sink. Alternatively, instead of calling invoke-callback , the sink can be specified directly. This is similar to calling attach-sink.

When the ole-control-pane is destroyed, the sinks are automatically detached.

There are currently three ways to insert an external component into an ole-control-pane. These are:

  1. Call ole-control-user-component, which asks the user for something to insert.
  2. Set the component-name of the pane. This can be done either via the initarg :component-name or by calling (setf component-name).
  3. Set the user-component of the pane, either via the initarg :user-component or by calling (setf ole-control-user-component).
Example
(capi:contain 
 (list 
  (make-instance 'capi:ole-control-pane
                 :component-name "OWC.Spreadsheet.9")))

This is a full example:

(example-edit-file "com/ole/html-viewer")
See also

attach-simple-sink
attach-sink
component-name
detach-sink
interface-menu-groups
ole-control-add-verbs
ole-control-close-object
ole-control-i-dispatch
ole-control-insert-object
ole-control-ole-object
ole-control-pane-frame
ole-control-user-component
report-active-component-failure


CAPI User Guide and Reference Manual (Windows version) - 3 Aug 2017

NextPrevUpTopContentsIndex