It requires at least AHK build 1.0.47.00.
Before downloading, please read first about Standard Library.
DOWNLOAD: COM.zip or COM_L.zip (for AutoHotkey_L) or AutoHotkey32/64 (COM is built into).
PREREQUISITE: ComCall via DllCall (Allowing Function Pointer in DllCall)
The usage of COM_Invoke():
If it has the form in VBS-like scripts as
value = Object.Function(param1, param2, ...) ; [color=red]Method, PropertyGet[/color]it'll be translated like
value := COM_Invoke(Object, "Function", param1, param2, ...)
And, if
Object.Function(param1, param2, ...) = value ; [color=red]PropertyPut, PropertyPutRef[/color]then similarly with the above
COM_Invoke(Object, "Function", param1, param2, ..., value)However, there exist occasions the above simple form becomes ambiguous. In those cases, can force it to use PropertyPut by appending to the function name the artificial suffix "=" like:
COM_Invoke(Object, "Function[color=red]=[/color]", param1, param2, ..., value)
There are some occasions where another COM Object ObjPrm should be a parameter. In that case, prefix it with "+" like:
COM_Invoke(Object, "Function", ..., "[color=red]+[/color]" . ObjPrm , ...) ; never directly prefix it like +ObjPrm.As a consequence, "+0" will play the role of VBS Nothing.
And, "-0" will represent VBS missing parameter. For eample
Object.Function(..., param1, , param3, ...)in VBS-like scripts can be written as
COM_Invoke(Object, "Function", ..., param1, "[color=red]-0[/color]" , param3, ...)
Finally, to control the error message pop-up of COM Library, call
COM_Error(b) ; b := 0/1 for off/on
REF. If like to use dot syntax, can use ez_invoke() and/or COM_InvokeDeep().
PS. The last updated time is the last edited time of this post.




