Error while Including Autohotkey.dll

Ask for help, how to use AHK_H, etc.
User avatar
Renz
Posts: 17
Joined: 05 Sep 2015, 21:56
GitHub: renzone
Location: Dortmund (NRW|GER)

Error while Including Autohotkey.dll

11 Mar 2018, 16:13

Hey :)

if i include the Autohotkey.dll with #Include, i get this error...

The Script:


The Error:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



anyone has an idea?
What it mean?
HotKeyIt
Posts: 1638
Joined: 29 Sep 2013, 18:35
Contact:

Re: Error while Including Autohotkey.dll

11 Mar 2018, 16:21

You can't include a dll, best is to use AHK_H with AutoHotkey.dll and AhkThread to launch a new thread.

Otherwise you will need to call DllCall("LoadLibrary","Str",PathToAutoHotkeyDLL,"Ptr"), and then start a thread using ahkdll or ahktextdll, see docs.
User avatar
Renz
Posts: 17
Joined: 05 Sep 2015, 21:56
GitHub: renzone
Location: Dortmund (NRW|GER)

Re: Error while Including Autohotkey.dll

11 Mar 2018, 16:37

Oh ok was wondering about that in the doc is written...

dllpath:=A_AhkDir "\AutoHotkey.dll"
DllCall("LoadLibrary","Str",dllpath) ; Load the AutoHotkey module.
DllCall(dllpath "\ahktextdll","Str","","Str","","CDecl") ; start a new thread, just the function.
DllCall(dllpath "\ahkExec","Str","MsgBox Hello World!","CDecl") ; add and execute code

; Same example like above but using included AutoHotkey.dll
dll:=AhkThread()
dll.ahkExec["MsgBox Hello World!"]

; Execute code in current thread
ahkExec("MsgBox Test")


The ; Same example like above but using included AutoHotkey.dll confusing me, Was a misstaken from me, sry about that...

But thank you for the fast answer :)

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 2 guests