OLE automation: Difference between revisions

m
whitespace
m (whitespace)
Line 8:
{{libheader|ComDispatch}} by [http://www.autohotkey.com/forum/author-fincs.html fincs]:[http://www.autohotkey.com/forum/topic66559.html discussion]
 
client: using the ahk ole server as well as the python ole server implemented below<lang autohotkey>
<lang autohotkey>ahk := comobjactive("ahkdemo.ahk")
ahk.hello("hello world")
py := ComObjActive("ahkdemo.python")
py.write("hello")
return</lang>
</lang>
server:
<lang autohotkey>#Persistent
#Persistent
CLSID_ThisScript := "{38A3EB13-D0C4-478b-9720-4D0B2D361DB9}"
APPID_ThisScript := "ahkdemo.ahk"
Line 72 ⟶ 70:
#include lib\ComDispTable.ahk
#include lib\ComDispatch.ahk
#include lib\ComVar.ahk</lang>
</lang>
 
=== {{header|Python}} ===
Line 134 ⟶ 131:
# autohotkey.exe ahkside.ahk
# python /c/Python26/Scripts/ipython.py -wthread -i pythonside.py
# must use -wthread otherwise calling com client hangs</lang>
client
</lang>
client<lang Python>import win32com.client
import win32com.client
client = win32com.client.Dispatch("python.client")
client.write("hello world")</lang>
</lang>
Anonymous user