Hello.
I am trying to make one of my .ahk libraries, but it doesn't work. It gives me an error saying I can't open the file.
Is there a program that will make me compile an .ahk to a .dll?
Thanks
Convert .ahk to .dll Topic is solved
-
- Posts: 52
- Joined: 02 Aug 2019, 15:39
Re: Convert .ahk to .dll
In AutoHotkey_H you can compile your script using AutoHotkey.dll.
After loading it you will need to run ahktextdll or ahkdll without script parameter.
After loading it you will need to run ahktextdll or ahkdll without script parameter.
-
- Posts: 52
- Joined: 02 Aug 2019, 15:39
Re: Convert .ahk to .dll
Sorry, I didn't include what I meant in my message.
Here's what I'm saying:
I actually made a library about 1~3 days ago, but I want to compile my library to .dll and make sure ahk understands it.
I tried to make my lib .dll, but it didn't work.
So I'm saying;
Is there a ".ahk to .dll" compiler?
Here's what I'm saying:
I actually made a library about 1~3 days ago, but I want to compile my library to .dll and make sure ahk understands it.
I tried to make my lib .dll, but it didn't work.
So I'm saying;
Is there a ".ahk to .dll" compiler?
signature C:
Re: Convert .ahk to .dll
I think what you need is the resourcelibrary in AutoHotkey_H.
Download ResourceHacker and check LIB resources in AutoHotkey.exe, the same way you can add your resource libraries.
Hese are default libraries included: https://github.com/HotKeyIt/ahkdll/tree/master/source/resources/reslib
Other than that AHK cannot load libraries from dll.
Download ResourceHacker and check LIB resources in AutoHotkey.exe, the same way you can add your resource libraries.
Hese are default libraries included: https://github.com/HotKeyIt/ahkdll/tree/master/source/resources/reslib
Other than that AHK cannot load libraries from dll.
Re: Convert .ahk to .dll
i too have a hard time following what ure saying
u made a library(in what language) that u need "ahk to be able to understand"
it sounds like u wrote something in c and ure asking how to compile it into a dll, but i cant be too sure
u made a library(in what language) that u need "ahk to be able to understand"
it sounds like u wrote something in c and ure asking how to compile it into a dll, but i cant be too sure
-
- Posts: 52
- Joined: 02 Aug 2019, 15:39
Re: Convert .ahk to .dll
I made a file that helps my script, made by the language AutoHotkey.
I want to Compile my library to a .dll, but when I #include it, it would be readable by AutoHotkey.
I want to Compile my library to a .dll, but when I #include it, it would be readable by AutoHotkey.
signature C:
Re: Convert .ahk to .dll
so u have a .ahk library(containing god knows what... functions presumably, but not necessarily) that u want to compile into a .dll, and then u want to load the now compiled .dll library back into ahk? why? what is the need for this backasswards approach?
as for how to do it: u write a C wrapper, calling the ahk functions(with ahk_h's autohotkey.dll), u compile it into a .dll, u write an .ahk wrapper, which loads the .dll in(and other required dependencies), retrieves the function pointers of the C wrapper functions(which themselves wrap ahk functions) and calls them. finally, u #include the ahk wrapper
...
as for how to do it: u write a C wrapper, calling the ahk functions(with ahk_h's autohotkey.dll), u compile it into a .dll, u write an .ahk wrapper, which loads the .dll in(and other required dependencies), retrieves the function pointers of the C wrapper functions(which themselves wrap ahk functions) and calls them. finally, u #include the ahk wrapper
...
-
- Posts: 52
- Joined: 02 Aug 2019, 15:39
Re: Convert .ahk to .dll
AFAIK, no!ceyhunveysel wrote: So I'm saying;
Is there a ".ahk to .dll" compiler?
Re: Convert .ahk to .dll
¯\_(ツ)_/¯
Re: Convert .ahk to .dll
Yes there is, in AHK_H.
But there is no way to use #include myahkdll.dll.
But there is AhkThread that can load the dll and the script can call the functions in that dll.
Re: Convert .ahk to .dll
I'm a bit confused by what you are doing. Maybe so are others. Did you write the code that you want to compile into a .dll, in the AutoHotkey language, or some other programming language? If you wrote the code in AutoHotkey, you can do what HotKeyIt has recommended, including also using #Include (https://www.autohotkey.com/docs/commands/_Include.htm). AutoHotkey programs with the .ahk extension can call functions from other .ahk labelled files, using #Include with the name and location of that file. If you are compiling your .ahk file into .exe, then you can use FileInstall (https://www.autohotkey.com/docs/commands/FileInstall.htm) to make sure the .ahk files you are calling functions from are included.ceyhunveysel wrote: ↑07 Dec 2019, 19:36Hello.
I am trying to make one of my .ahk libraries, but it doesn't work. It gives me an error saying I can't open the file.
Is there a program that will make me compile an .ahk to a .dll?
Thanks
If you wrote the code in a different programming language, you can compile it into a .dll with that language, then possibly call it with AutoHotkey using DllCall() (https://www.autohotkey.com/docs/commands/DllCall.htm).
As HotKeyIt has described, AutoHotkey_H gives you additional options as well.
- Blackholyman
- Posts: 1293
- Joined: 29 Sep 2013, 22:57
- Location: Denmark
- Contact:
Re: Convert .ahk to .dll
I feel that this topic is filled with misunderstanding
Im not sure if OP really has a need for a dll
as to me it seems that he just wishes to include some other ahk code he made
but his attempt to use include have not worked so he now believes that he needs to make it in to a dll
OP that is not how you do that in AutoHotkey
Something that can help to clear up misunderstandings like this is to post your code, both the code (script) you wish to include and the code (script) you with to include it in...
Im not sure if OP really has a need for a dll
as to me it seems that he just wishes to include some other ahk code he made
but his attempt to use include have not worked so he now believes that he needs to make it in to a dll
OP that is not how you do that in AutoHotkey
Something that can help to clear up misunderstandings like this is to post your code, both the code (script) you wish to include and the code (script) you with to include it in...
Courses on AutoHotkey
My Autohotkey Blog
-
- Posts: 52
- Joined: 02 Aug 2019, 15:39
Re: Convert .ahk to .dll
OK! Goddamnit! I'm gonna explain this ONE MORE TIME and the FINAL TIME.
I've made an AutoHotkey script, that I will include on one of my OTHER scripts.
But I want to compile my FIRST script to a .dll and #Include it in one of my scripts, but AHK would understand the FIRST script I created and load it's functions when I call them.
PLEASE like PLEASE say you understood that. FFS.
I've made an AutoHotkey script, that I will include on one of my OTHER scripts.
But I want to compile my FIRST script to a .dll and #Include it in one of my scripts, but AHK would understand the FIRST script I created and load it's functions when I call them.
PLEASE like PLEASE say you understood that. FFS.
signature C:
Re: Convert .ahk to .dll
Simple, you don't need to compile it:But I want to compile my FIRST script to a .dll and #Include it in one of my scripts
Code: Select all
; Your other script in that file starts from first line and can call functions from other script...
Return ; end of the other script to make sure it does not fall trough to the FIRST script
; FIRST.ahk needs to be in same directory, see help file for options
#include FIRST.ahk
-
- Posts: 52
- Joined: 02 Aug 2019, 15:39
Re: Convert .ahk to .dll
I said that I would compile it as a .dll.compile it as a .dll
Hope you got it.
signature C:
Re: Convert .ahk to .dll
I have the perfect solution
1. Rename your mylibrary.ahk file to mylibrary.dll
2. Then use #include mylibrary.dll
1. Rename your mylibrary.ahk file to mylibrary.dll
2. Then use #include mylibrary.dll
Who is online
Users browsing this forum: CoffeeChaton and 100 guests