OLE automation: Difference between revisions
m
syntax highlighting fixup automation
(Added Wren) |
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
||
Line 15:
client: using the ahk ole server as well as the python ole server implemented below
<
ahk.hello("hello world")
py := ComObjActive("python.server")
py.write("hello")
return</
server:
<
CLSID_ThisScript := "{38A3EB13-D0C4-478b-9720-4D0B2D361DB9}"
APPID_ThisScript := "ahkdemo.ahk"
Line 76:
#include lib\ComDispTable.ahk
#include lib\ComDispatch.ahk
#include lib\ComVar.ahk</
=={{header|Go}}==
Line 83:
<br>
This uses OLE automation to create a new Microsoft Word document, write some text to it and after 10 seconds close the document without saving and quit Word.
<
import (
Line 112:
ole.CoUninitialize()
}</
=={{header|M2000 Interpreter}}==
Line 118:
We can use Events, from declared objects and from objects that we get as result from methods, using WithEvents.
<syntaxhighlight lang="m2000 interpreter">
Module CheckAutomation {
ExitNow=false
Line 150:
}
CheckAutomation
</syntaxhighlight>
=={{header|Phix}}==
Line 160:
Server uses a client of the ahk server above to register the clsid in the windows registry.
Translated from <tt>win32com/test/testDynamic.py</tt>
<
# -*- coding: utf-8 -*-
import win32com.client
Line 215:
# autohotkey.exe ahkside.ahk
# python /c/Python26/Scripts/ipython.py -wthread -i pythonside.py
# must use -wthread otherwise calling com client hangs</
client
<
client = win32com.client.Dispatch("python.server")
client.write("hello world")</
=={{header|Wren}}==
Line 227:
{{works with|Windows 10}}
An embedded application with a Go host so we can use the Go OLE library.
<
class Ole {
Line 282:
IUnknown.release(word)
Ole.coUninitialize()</
<br>
We now embed this script in the following Go program and run it.
<
package main
Line 424:
vm.InterpretFile(fileName)
vm.Free()
}</
{{omit from|Ada|Too involved to implement from scratch, and OS specific}}
|