1 COM Methods and Properties

▼ |  | Myster X: Legacy Support for Windows COM

1 | COM Methods and Properties
2 | COM Types
3 | COM Events
4 | Version
| Index

On this page:

com-all-coclasses
com-all-controls
cocreate-instance-from-coclass
cci/ coclass
cocreate-instance-from-progid
cci/ progid
com-get-active-object-from-coclass
gao/ coclass
coclass
progid
set-coclass!
set-coclass-from-progid!
com-methods
com-method-type
com-invoke
com-get-properties
com-get-property-type
com-get-property
com-set-properties
com-set-property-type
com-set-property!
com-help
com-object-eq?
com-object?

top contents ← prev up next →

### 1`` COM Methods and Properties🔗ℹ

MysterX allows scripting of most COM components from Racket. A COM component can be scripted in MysterX if it supports OLE Automation via the IDispatch interface, and if it publishes type information using the ITypeInfo interface.

> procedure (com-all-coclasses) → (listof string?)

Returns a list of strings for all COM classes registered on a system.

> procedure (com-all-controls) → (listof string?)

Returns a list of strings for all COM classes registered on a system that have the "Control" subkey.

> > procedure
> > (cocreate-instance-from-coclass |  | coclass |  |  |  |
> > | [ | where]) |  | → |  | com-object?
> coclass : string?
> where : (or/c (one-of/c 'local 'remote) string?) = 'local
> procedure (cci/coclass coclass [where]) → com-object?
> coclass : string?
> where : (or/c (one-of/c 'local 'remote) string?) = 'local

Returns an instance of coclass. This is useful for COM classes without a visual representation, or when a visual representation is not needed.

The optional argument where indicates a for running the instance, and may be 'local, 'remote, or a string indicating a machine name. See Remote COM servers (DCOM) for more information.

> > procedure
> > (cocreate-instance-from-progid |  | progid |  |  |  |
> > | [ | where]) |  | → |  | com-object?
> progid : string?
> where : (or/c (one-of/c 'local 'remote) string?) = 'local
> procedure (cci/progid progid [where]) → com-object?
> progid : string?
> where : (or/c (one-of/c 'local 'remote) string?) = 'local

Like cocreate-instance-from-coclass, but using a ProgID.

> procedure (com-get-active-object-from-coclass coclass) → com-object?
> coclass : string?
> procedure (gao/coclass coclass) → com-object?
> coclass : string?

Like cocreate-instance-from-coclass, but gets an existing active object (always local) instead of creating a new one.

> procedure (coclass obj) → string?
> obj : com-object?

Returns a string that is the name of the COM class instantiated by obj, or raises an error if the COM class is not known.

> procedure (progid obj) → string?
> obj : com-object?

Returns a string that is the name of the ProgID instantiated by obj, or raises an error if the COM class is not known.

> procedure (set-coclass! obj coclass) → void?
> obj : com-object?
> coclass : string?

Sets the COM class for obj to coclass. This is useful when MysterX COM event-handling procedures can obtain only ambiguous information about the object’s COM class.

> procedure (set-coclass-from-progid! obj progid) → void?
> obj : com-object?
> progid : string?

Like set-coclass!, but using a ProgID.

> procedure (com-methods obj/type) → (listof string?)
> obj/type : (or/c com-object? com-type?)

Returns a list of strings indicating the names of methods on obj/type.

> procedure (com-method-type obj/type method-name) → (listof symbol?)
> obj/type : (or/c com-object? com-type?)
> method-name : string?

Returns a list of symbols indicating the type of the specified method in obj/type. See COM Types for information on the symbols.

> procedure (com-invoke obj method-name v ...) → any/c
> obj : com-object?
> method-name : string?
> v : any/c

Invokes method-name on obj with vs as the arguments. The special value com-omit may be used for optional arguments, which useful when values are supplied for arguments after the omitted argument(s).

> procedure (com-get-properties obj/type) → (listof string?)
> obj/type : (or/c com-object? com-type?)

Returns a list of strings indicating the names of readable properties in obj/type.

> > procedure
> > (com-get-property-type |  | obj/type |  |  |  |
> > |  | property-name) |  | → |  | (listof symbol?)
> obj/type : (or/c com-object? com-type?)
> property-name : string?

Returns a list of symbols indicating the type of the specified property in obj/type. See COM Types for information on the symbols.

> procedure (com-get-property obj property ...+) → any/c
> obj : com-object?
> | property |  | : |  |
> (or/c string?
> (cons/c string? list?))

Returns the value of the final property by following the indicated path of propertys, where each intermediate property must be a COM object.

Each property is either a property-name string or a list that starts with a property-name string and continues with arguments for a parameterized property.

> procedure (com-set-properties obj/type) → (listof string?)
> obj/type : (or/c com-object? com-type?)

Returns a list of strings indicating the names of writeable properties in obj/type.

> > procedure
> > (com-set-property-type |  | obj/type |  |  |  |
> > |  | property-name) |  | → |  | (listof symbol?)
> obj/type : (or/c com-object? com-type?)
> property-name : string?

Returns a list of symbols indicating the type of the specified property in obj/type. See COM Types for information on the symbols.

> procedure (com-set-property! obj property ...+ v) → void?
> obj : com-object?
> | property |  | : |  |
> (or/c string?
> (cons/c string? list?))
> v : any/c

Sets the value of the final property in obj to v by following the propertys, where the value of each intermediate property is a COM object. A property can be a list instead of a string to represent a parameterized property and its arguments.

> procedure (com-help obj/type [topic]) → void?
> obj/type : (or/c com-object? com-type?)
> topic : string? = ""

Starts the Window Help system with help about the COM object or COM type. The optional topic is typically a method or property name.

> procedure (com-object-eq? obj1 obj2) → boolean?
> obj1 : com-object?
> obj2 : com-object?

Returns #t if the two COM objects are the same, #f otherwise.

> procedure (com-object? obj) → boolean?
> obj : com-object?

Returns #t if the argument is a COM object, #f otherwise.
top contents ← prev up next →