2.3 COM Events

► |  | Myster X: Using Windows COM Objects in Racket

1 | Overview
2 | COM
3 | Active X and DHTML
4 | Version
| Index

▼ | 2 | COM

2.1 | COM Methods and Properties
2.2 | COM Types
2.3 | COM Events

On this page:

com-events
com-event-type
com-register-event-handler
com-unregister-event-handler

top← prev up next →

#### 2.3`` COM Events

COM events are generated by COM objects. Unlike HTML events, there is no fixed set of COM events, though there are “stock” events that many COM objects support. MysterX allows the programmer to write handlers for both stock and custom events.

( com-events obj/type) → ( listof string?)
obj/type : ( or/c com-object? com-type?)

Returns a list of strings naming the events supported by obj/type.

If calling this procedure results in an error indicating that the COM object’s coclass is ambiguous, try using either set-coclass! or set-coclass-from-progid!, then retry com-events.

( com-event-type obj/type ev) → ( listof string?)
obj/type : ( or/c com-object? com-type?)
ev : string?

Returns the type of an event handler for the event ev generated by the particular COM object/type obj/type. The return type of all COM event handlers is void.

See also com-events for dealing with a COM object that has an ambiguous class.

( com-register-event-handler obj ev f) → void?
obj : com-object?
ev : string?
f : ( any/c . -> . any)

Registers f as event handler for the event ev when generated by obj. The type of argument supplied to f depends on the event; the result of f is always discarded.

See also com-events for dealing with a COM object that has an ambiguous class.

( com-unregister-event-handler obj ev) → void?
obj : com-object?
ev : string?

Unregisters any event handler for the event ev that is generated by the COM object obj.
top← prev up next →