All Manuals > COM/Automation User Guide and Reference Manual > 4 Automation Reference Entries

create-instance-with-events Function

Summary

A convenience function which combines create-instance and set-i-dispatch-event-handler.

Package

com

Signature

create-instance-with-events clsid event-handler &rest args &key event-object => interface, sinks

Arguments
clsid
A string or a refguid giving a CLSID to create.
event-handler
A function of four arguments.
args
Lisp objects.
event-object
A Lisp object.
Values
interface
An i-dispatch interface.
sinks
A list of objects representing the connections made.
Description

The function create-instance-with-events is a convenience function which starts an i-dispatch interface and sets an event handler.

It first calls create-instance with clsid and all the keyword arguments in args except :event-object. clsid defaults the create-instance argument riid to the value i-dispatch.

It then calls set-i-dispatch-event-handler on the resulting interface, passing event-handler, event-object and clsid (as the coclass).

interface is the interface started, and sinks is the result of set-i-dispatch-event-handler.

Examples
(example-edit-file "com/automation/events/ie-events")
See also

create-instance
set-i-dispatch-event-handler


COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:41