Guest_AutoHotkey_L wrote:
tinku99 wrote:
I have fixed ahkFunction so it doesn't crash. I have also cleaned up its implementation a little.
Thanks for taking a look and working on a fix.
I confirmed that there is no more crashing

I don't seem to be getting back the strings I'm expecting from ahkFunction though...
Should I try to provide some code to reproduce?
Any comments on this?
The crashing from before seems gone, but for the cases I've tested, ahkFunction doesn't appear to be returning the string values I expect. I see only '1'.
Tried to reproduce with a smaller set of code which is below. I think it demonstrates some issue, but the results don't appear to be the same as in the full-blown scenario (still seems problematic though):
With the AutoHotkey.dll in the ReleaseA directory of the HotkeyIt zip file (1.
0.48.05.L52dllH17 SHA-1: fb41686713b7319e2e85e3b3409b606c55ad8870) ahkFunction appears to return strings as expected.
With the most recent tinku99 AutoHotkey.dll I have here (SHA-1: 0e4c7daf198dc56524757015dea46f48b7400ec1) ahkFunction appears to return an empty string.
ahkFunctionReturnValue.ahk
Code:
#NoEnv
#Persistent
OutputDebug, % "-------"
OutputDebug, % "A_AhkVersion: " . A_AhkVersion
AHKDllPath := A_ScriptDir . "\AutoHotkey.dll"
OutputDebug, % "About to call LoadLibrary"
handleLibrary
:= DllCall("LoadLibrary"
, "Str", AHKDllPath)
If (ErrorLevel != 0)
{
OutputDebug, % "DllCall (LoadLibrary) set ErrorLevel to: " . ErrorLevel
ExitApp
}
OutputDebug, % "DLLCall (LoadLibrary) returned: " . handleLibrary
OutputDebug, % "About to call ahkdll"
Result
:= DllCall(AHKDllPath . "\ahkdll"
, "Str", A_ScriptDir . "\helper.ahk"
, "Str", ""
, "Str", ""
, "Cdecl UInt")
If (ErrorLevel != 0)
{
OutputDebug, % "DllCall (ahkdll) set ErrorLevel to: " . ErrorLevel
ExitApp
}
OutputDebug, % "DllCall (ahkdll) returned: " . Result
Parameter := "Hoping this comes back"
OutputDebug, % "About to call ahkFunction"
Result
:= DllCall(AHKDllPath . "\ahkFunction"
, "Str", "InHelper"
, "Str", Parameter
, "Cdecl Str")
If (ErrorLevel != 0)
{
OutputDebug, % "DllCall (ahkFunction) set ErrorLevel to: " . ErrorLevel
}
OutputDebug, % "DllCall (ahkFunction) returned: " . Result
If (Result == "")
{
OutputDebug, % " Result appears to be empty..."
}
OutputDebug, % "About to call FreeLibrary"
Result
:= DllCall("FreeLibrary"
, "UInt", handleLibrary)
If (ErrorLevel != 0)
{
OutputDebug, % "DllCall (FreeLibrary) set ErrorLevel to: " . ErrorLevel
ExitApp
}
OutputDebug, % "DllCall (FreeLibrary) returned: " . Result
ExitApp
helper.ahk
Code:
#Persistent
OutputDebug, % "Via DLL: A_AhkVersion: " . A_AhkVersion
InHelper(PassedThing)
{
OutputDebug, % "Via DLL: InHelper entered with: " . PassedThing
Return PassedThing
}