COM

Object creation

Script
Function

ComObject gkScript.createComObject(string id, bool inProcess)

Will create a COM object. - id can be a CLSID or a ProgID - Set inProcess to true for in-process objects, false for local servers.

ComObject gkScript.getComObject(string id)

Will attach to a running COM server. - id can be a CLSID, a ProgID or a Moniker

ComObject class

enum InvokeTypes {
    DISPATCH_METHOD,
    DISPATCH_PROPERTYGET,
    DISPATCH_PROPERTYPUT,
    DISPATCH_PROPERTYPUTREF
};


class ComObject
{
    bool connected();          // return true if ComObject is connected to COM server
    void disconnect();

    value invoke(string name, vector params);              // invoke a function
    value invoke(string name, InvokeTypes type, vector params);              // invoke a function with specified invoke type
    value getProp(string prop);                            // read property
    bool setProp(string prop, val);                        // write property
}

Sample:

Last updated

Was this helpful?