Ahk_Hv2.0 Ahk2Exe

Ask for help, how to use AHK_H, etc.
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Ahk_Hv2.0 Ahk2Exe

06 Feb 2020, 10:45

Hello, I'm trying to setup the compiler for AHK_H v2, but having issues.

Are we meant to use a combo of AHK v2 (legit) .bin files, the old Ahk2Exe.exe and compile the Ahk2Exe.ahk file?

Or, are we meant to use the Ahk2Exe solution on github?

I also tried following the instructions near the top of this thread, and got the following error messages below.

I tried all 4 .exe files, normal and MT. The Win32w versions gave me BOTH errors. The x64w versions gave me only the 1st error.

Any comments would help.
Error Invalid Number of Parameters - Line 40.png
Error Invalid Number of Parameters - Line 40.png (11.49 KiB) Viewed 5966 times
Error CONTINUABLE EXCEPTION_ACCESS_VIOLATION.png
Error CONTINUABLE EXCEPTION_ACCESS_VIOLATION.png (9.42 KiB) Viewed 5966 times
================
================
================

EDIT: The Ahk2Exe github solution at least opens and compiles a simple MsgBox("hello world") script. What is the recommended compiler currently?
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: AHKv2.0 Ahk2Exe

06 Feb 2020, 17:31

TheArkive wrote:
06 Feb 2020, 10:45
Hello, I'm trying to setup the compiler for AHK_H v2, but having issues.
you should ask in the AHK_H subforum

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

28 Feb 2020, 13:32

@guest3456 my bad ... I thought the AHK_H "ask for help" subform was the right place ... is that not so?

Just don't want to post the wrong thing in the wrong place....
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Ahk_Hv2.0 Ahk2Exe

28 Feb 2020, 13:56

i think it was originally in the main Ask For Help, and a moderator moved it here now

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

28 Feb 2020, 14:08

@guest3456 should I repost there? I've learned a lout about Ahk2Exe for AHK v1 and v2 (deceptively simple) ... but AHK_H is still an enigma to me ...
gregster
Posts: 9012
Joined: 30 Sep 2013, 06:48

Re: Ahk_Hv2.0 Ahk2Exe

28 Feb 2020, 14:58

TheArkive wrote:
28 Feb 2020, 14:08
should I repost there?
Should be fine here.
Afaics, HotKeyIt split these posts from another topic and put them here (already on 06 Feb 2020).
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

27 Apr 2020, 01:22

@HotKeyIt
I'm getting these same errors again with the latest release of AHK_H v1 and v2 compiler...
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

27 Apr 2020, 02:28

Question ... is your Ahk2Exe for AHK v2 repository just a sketch pad you mess with? Or is this meant to become a standard or alternate compiler for some/all/certain versions of AHK?
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

30 Apr 2020, 02:04

@HotKeyIt thanks :-) ... working great!

What is the major difference when selecting the Base File as .bin, .dll, or .exe for compiling? Is that compiling the selected .bin / .exe / .dll into the resulting exe? Or just using the instructions from that base?

EDIT: I apologize, let me rephrase...

I know what the .bin does, and I know that the .exe allows for using /E on compiled script to run another script. Is that the only other function of compiling with "AutoHotkey.exe"? I definitely don't know what compiling with the .dll does.
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

30 Apr 2020, 05:01

Yes, main difference is /E but also that addFile and addScript work, they don't work in bin.
A compiled AutoHotkey.dll can be started by calling ahktextdll or ahkdll without parameters (just like AutoHotkey.exe).
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

30 Apr 2020, 05:58

HotKeyIt wrote:
30 Apr 2020, 05:01
A compiled AutoHotkey.dll can be started by calling ahktextdll or ahkdll without parameters (just like AutoHotkey.exe).
Ok I think I'm understanding ... still learning what AHK_H does, and how this version of Ahk2Exe functions ... some of the terminology is new to me in the help docs ... like "Exported function".

So, if compiled with AutoHotkey.dll, then the compiled EXE can call upon the AutoHotkey.dll specific commands (without AutoHotkey.dll present)? Will AutoHotkey.dll be included in the compiled exe? Or will it still need to be distributed with the EXE?

Can an exe compiled with AutoHotkey.exe be distributed with AutoHotkey.dll and still call upon those specific functions?

EDIT: Also, is AutoHotkey.dll used at all to actually compile a script into a DLL for use with other applications? Or am I way off there?

I noticed that between the MD and MT versions, with the compiled MSVC dll being included caused some potential memory leaks. Are any such side effects known as a result of compiling with AutoHotkey.dll base?
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

30 Apr 2020, 10:46

TheArkive wrote:
30 Apr 2020, 05:58
1. Ok I think I'm understanding ... still learning what AHK_H does, and how this version of Ahk2Exe functions ... some of the terminology is new to me in the help docs ... like "Exported function".
2. So, if compiled with AutoHotkey.dll, then the compiled EXE can call upon the AutoHotkey.dll specific commands (without AutoHotkey.dll present)? Will AutoHotkey.dll be included in the compiled exe? Or will it still need to be distributed with the EXE?
3. Can an exe compiled with AutoHotkey.exe be distributed with AutoHotkey.dll and still call upon those specific functions?
4. EDIT: Also, is AutoHotkey.dll used at all to actually compile a script into a DLL for use with other applications? Or am I way off there?
5. I noticed that between the MD and MT versions, with the compiled MSVC dll being included caused some potential memory leaks. Are any such side effects known as a result of compiling with AutoHotkey.dll base?
1. exes and dlls can export function so they are accessible from outside of the program (like ahktextdll, or addFile...)
2+3. AutoHotkey.dll is aready included regardless of compilation.
4. When AutoHotkey.dll is compiled, it is used as base file and other application can loadlibrary and call ahkdll to start compiled/included script.
5. Compiled or not, both exe and dll MT version may cause access violation when accessing (especially deleting) the memory of each other.
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

30 Apr 2020, 11:14

@HotKeyIt
thanks for the explanation :-)

By the way, AHK_H v2 compiler gives error messages when clicking checkboxes. Just need to add Control := p[1] underneath the "global" line in CheckCompression() function.

Edit: I got the checkboxes working using this:

Code: Select all

CheckCompression(p*){
  global
  Control := p[1]
  GuiSubMit := Control.Gui.SubMit(0)
  If Control.name="UseCompression" && !GuiSubMit.UseCompression {
	GuiUseEncrypt.value := false
    GuiUseCompression.value := false
  } else If Control.Name="UseEncrypt" && GuiSubMit.UseEncrypt {
    GuiUseCompression.value := true
  }
}
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

01 May 2020, 01:04

@HotKeyIt
Cool thanks! Is Ahk2Exe.ahk meant to be compiled? I get an error when I try. I have no real need to do so. Just wondering / learning.
Annotation 2020-05-01 080321.png
Annotation 2020-05-01 080321.png (12.1 KiB) Viewed 4159 times
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Ahk_Hv2.0 Ahk2Exe

01 May 2020, 07:45

wait, are we supposed to use the Ahk2exe dedicated repo?

i've always just used whatever came bundled in the 'release' repo

User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

01 May 2020, 09:26

@guest3456
I don't think so, I was just wondering if AHK_H version of Ahk2Exe was meant to be compiled by itself. I use the included compiler in AHK_H releases.
TAC109
Posts: 1112
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Ahk_Hv2.0 Ahk2Exe

01 May 2020, 16:35

Have you read the installation instructions from here? (Press the 'show' button).
Currently no installer is available, simply replace your AutoHotkey.exe with relevant AutoHotkey.exe from downloaded package and you are ready to go.
Compiler folder will need to be replaced as well if needed.
Copy AutoHotkey.exe to Compiler folder afterwards and rename it to Ahk2Exe.exe.
To compile ANSI version you will need the exe from Win32a and for Unicode from Win32w or x64w.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Ahk_Hv2.0 Ahk2Exe

02 May 2020, 00:51

Sorry for the misunderstanding, I'm not confused on how to set it up. I was just wondering if it was able or meant to compile itself. That's all.

EDIT: My copy is setup and working nicely. I did read, and clicked "Show" ... sorry for the confusion.

Return to “Ask for Help”

Who is online

Users browsing this forum: No registered users and 44 guests