HotKeyIt / ahkdll-v2-release

AutoHotkey_H v2 release

Home Page:http://hotkeyit.github.io/v2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AhkThread() use v2's dll not work

telppa opened this issue · comments

; OutputVar := AhkThread("msgbox 'abc'", "", 0, "AutoHotkeyU64_V1.dll") ; this work
OutputVar := AhkThread("msgbox 'abc'", "", 0, "AutoHotkeyU64_V2.dll")   ; this not work

; my exe is ahk_h_v1_x64.
; system win10 2016 ltsc.

After registering the dll of AutoHotkeyU64_V2, using the following code in ahk_h_v1_x64.exe still does not work.

AhkCom := ComObjCreate("AutoHotkey2.Script")
AhkCom.ahktextdll("MsgBox 'Hello World!`nExitApp'")
While AhkCom.ahkReady()
Sleep, 100
MsgBox Exiting now

After registering the dll of AutoHotkeyU64_V2, using the following code in ahk_h_v1_x64.exe still does not work.

hModule:=DllCall("LoadLibrary","Str",A_AhkDir "\AutoHotkeyU64_V2.dll")
ahk:=ComObjDll(hModule,"{FEEEC4BA-04AF-45F0-B385-7290C65CFB9B}") ; CLSID for Version 2.0
hModule:=DllCall("LoadLibrary","Str",A_AhkDir "\AutoHotkeyU64_V2.dll")
ahk:=ComObjDll(hModule,"{F1D0DE03-30FD-4326-B33F-989BBFAA5FFA}") ; CLSID for Version 2.0

Since v2 is not compatible with v1, I would like to use v1_h.exe to call v2_h.dll to implement some new features without changing the old code.

I think this may be a better way to transition from v1 to v2.

V2 will not have COM dll, instead the exe will be COM enabled.