Jump to content


AhkDllThread on AHK_L (_Struct missing??)


  • Please log in to reply
6 replies to this topic

#1 Guests

  • Guests

Posted 24 May 2012 - 08:51 PM

I'm trying to use the AhkDllThread function in AHK_L (I read somewhere that it's compatible with L) so I include the file AhkDllThread.ahk in my script.
But when I execute it I get an error about a _Struct file not found.

Where can I get this _Struct file?
I cant found it in the AHK_H download.

#2 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 24 May 2012 - 10:00 PM

<!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?t=59581">viewtopic.php?t=59581</a><!-- l -->

#3 Guests

  • Guests

Posted 24 May 2012 - 10:37 PM

Thanks engunneer.

Now the script compiles.
I'm just trying the basic script at the bottom of this page:
<!-- m -->http://www.autohotke... ... e-txt.html<!-- m -->
#include AhkDllThread.ahk

AhkThread := AhkDllThread("AutoHotkey.dll")
AhkThread.ahktextdll("SplashTextOn,130,20, From AutoHotkey.dll,Hello World!")
MsgBox, Press Ok to terminate Thread.
AhkThread.ahkterminate()
MsgBox, Thread was terminated.
The script starts, but I get this error:
Posted Image

What could be the problem?

#4 HotKeyIt

HotKeyIt
  • Fellows
  • 6132 posts

Posted 25 May 2012 - 06:39 AM

What _L/_H versions are you using?

I just downloaded AHK_L Unicode and AutoHotkey.dll Unicode to a separate foder.
Then created a lib folder there and downloaded AhkDllThread.ahk, sizeof, _Struct.ahk and _MemoryLibrary.ahk into this lib folder.
Then created the following script, saved as AutoHotkey.ahk in same folder where AHK_L and AHK.dll are.
#include <AhkDllThread>

AhkThread := AhkDllThread("AutoHotkey.dll")
AhkThread.ahktextdll("#Persistent`nSplashTextOn,130,20, From AutoHotkey.dll,Hello World!")
MsgBox, Press Ok to terminate Thread.
AhkThread.ahkterminate()
MsgBox, Thread was terminated.

It works for me :?

#5 Guests

  • Guests

Posted 25 May 2012 - 02:16 PM

I'm using latest verisons of AHK_L unicode and AHK.dll ansi.
I'll try with AHK.dll unicode, may be that's the problem.

#6 Guests

  • Guests

Posted 25 May 2012 - 02:23 PM

Yep... that was the problem :oops:

I didn't know they couldn't interoperate between ansi and unicode.
Thanks for you time :)

#7 HotKeyIt

HotKeyIt
  • Fellows
  • 6132 posts

Posted 27 May 2012 - 06:21 PM

They can, but only trough COM Interface.
You can even load the dll without registering it, using ComObjDll (only available in AHK_H).