Can't dynamically call ahk_h's function Topic is solved

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Can't dynamically call ahk_h's function

Post by kyuuuri » 05 Mar 2019, 07:58

Here is the test code:

Code: Select all

#persistent
thrd =
(
msgbox asdasd
)
func := "ahkthread"
asd := %func%(thrd)
esc::exitapp
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Can't dynamically call ahk_h's function  Topic is solved

Post by HotKeyIt » 05 Mar 2019, 16:03

Yes because the function is included AHK function and not a build-in function, see here: https://github.com/HotKeyIt/ahkdll/tree/master/source/resources/reslib
To be able to call it dynamically you have to #include <AhkThread> it before.
kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Re: Can't dynamically call ahk_h's function

Post by kyuuuri » 05 Mar 2019, 17:34

Then that's why hahaha, thank you!.
1 Question:
If I'm compiling an script that doesn't use any of the functions in /Lib folder do those function get included on my final exe as well? Removing the files will break something in the script?
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Can't dynamically call ahk_h's function

Post by HotKeyIt » 05 Mar 2019, 18:53

Only functions that are used in your script or via #include are included!
kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Re: Can't dynamically call ahk_h's function

Post by kyuuuri » 07 Mar 2019, 22:08

Forgot to say, thank you!. I keep asking things that I can easily google, my bad :D. Have a nice day!.
Post Reply

Return to “AutoHotkey_H”