A_AhkExe() error
Posted: 15 Apr 2019, 05:59
Hi, I have an issue with a script using A_AhkExe function - Access Violation error pops up when I try to reload the script. The script runs ok until Alt+X hotkey is pressed. This happens in any script where A_AhkExe is present.
I tried to put the DllCall part to a new line and it works, however I still get an error from time to time, not sure this is the right solution. You provided me with the function long time ago and I wonder if there is an update? Thanks.
I tried to put the DllCall part to a new line and it works, however I still get an error from time to time, not sure this is the right solution. You provided me with the function long time ago and I wonder if there is an update? Thanks.
Code: Select all
string:="
(
#Persistent
!y::
Input(""This is my Text"")
return
!x::Reload
Input(Text){
DllCall(A_AhkExe() ""\ahkFunction"",""Str"",""MyFunction"",""Str"", Text, ""Cdecl Str"")
return
}
A_AhkExe(){
static e,i:=VarSetCapacity(e,520) DllCall(""GetModuleFileName"",PTR,0,Str,e,UInt,260) VarSetCapacity(e,-1)
return e
}
)"
dll0:=ahkthread(string)
return
MyFunction(Text){
msgbox % Text
return
}