DllCall Produces Strange Error Code
DllCall Produces Strange Error Code
In order to use C++ code within AutoHotkey, I've been writing the code into functions that I compile into DLLs with Visual Studio and call with DllCall(). However, while most of the functions work as expected and set ErrorLevel to 0 after being called, they always set A_LastError to 126—"The specified module could not be found." Is this something that I should be concerned about?
Re: DllCall Produces Strange Error Code
Are you loadlibrary firs?
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
Re: DllCall Produces Strange Error Code
not necessarily, if ur functions dont call SetLastError what u are observing might be the remnants of previous winapi calls
or there might be something wrong with ur code, who knows
or there might be something wrong with ur code, who knows
Re: DllCall Produces Strange Error Code
Could it be DllMain()? I just used the default version provided with the Visual Studio template.
Re: DllCall Produces Strange Error Code
probably not. u can try calling SetLastError urself with some bogus value beforehand and check whether it remains the same throughout.
Re: DllCall Produces Strange Error Code
Using SetLastError(0); inside one of the functions resulted in an A_LastError value of zero.
If I call SetLastError(n) before calling one of my functions, the value n is preserved through the function call.
If I call SetLastError(n) before calling one of my functions, the value n is preserved through the function call.
Re: DllCall Produces Strange Error Code
I think I've determined that the error code comes from the call to LoadLibrary() that I perform before calling the function; apparently, my call to GetProcAddress() afterward has no effect on the value.
Who is online
Users browsing this forum: No registered users and 9 guests