Jump to content


AhkDllThread.ahk makes the #include directive unusable


  • Please log in to reply
2 replies to this topic

#1 Guests

  • Guests

Posted 19 June 2012 - 11:10 AM

After you include AhkDllThread.ahk, every following use of the #include command fail to find any file.
msgbox hi!

#include test.ahk  ; [color=#FF0000]<--- file is found and included[/color]
#include <AhkDllThread>
#include test.ahk  ; [color=#FF0000]<--- file is not found[/color]
Tested with AHK_L v1.1.07.03

#2 HotKeyIt

HotKeyIt
  • Fellows
  • 6132 posts

Posted 19 June 2012 - 07:56 PM

I do not think this is related to AHKDllThread() function.
As I understand after #include <> has been used the default "#include directory" changes to the path wherever the included file sits.

To work around that I use:
#include test.ahk
#include <AhkDllThread>
[color=#FF0000]#Include %A_ScriptDir%[/color]
#include test.ahk


#3 Guests

  • Guests

Posted 20 June 2012 - 11:49 AM

If I do this:
#include test.ahk
#include lib\AhkDllThread.ahk
#include test.ahk
the problem happens anyways.

I guess it's because AhkDllThread.ahk has in turn an #include <> inside itself.
That means that whenever you include a script, if that script has an #include <> either direcly or indirectly (by including another script with in turn has a #include <>), this problem is going to happen. And the cause will be completely hidden because the #include <> could be nested very deeply in the whole chain of included scripts (I'm thinking in large projects particularly).

I strongly believe that this is an undesired bahavior.