![Bravo! :bravo:](./images/smilies/bravo.gif)
I found that PY calls DLL without specifying the parameter type. This is very convenient, using DLL becomes very simple. So can we achieve the same effect in V2?
Its definitely .py PythonWhat is PY?
It was partially tackled in AHK_H V2 branch (by @HotKeyIt) with DllCall's equivalent named DynaCall.
Code: Select all
DllCall DynaCall equivalent
Int i
Str s
AStr a
WStr w
Short h
Char c
Float f
Double d
PTR t
Int64 i6
Thank u for reminding of this feature! I might rethink of rewriting dllcalls into shorthanded v128+ function call variants!with DllCall.Bind, now without the need for %% or .Call. The cost of calling via BoundFunc is negligible even for very small/fast functions like MulDiv, and would only become less significant with larger functions.
Of course in C long is not a 64 bits integer.lexikos wrote: ↑13 Mar 2021, 20:37No, it isn't better. long and long int are 32-bit (on all the platforms AutoHotkey runs on).
If you want to save characters, there are numerous solutions that can be implemented in script, with DllCall.Bind, now without the need for %% or .Call. The cost of calling via BoundFunc is negligible even for very small/fast functions like MulDiv, and would only become less significant with larger functions. If the alternative DllCall wasn't automatically optimized by having its function address resolved at load time, doing that manually and binding the address will give a better result.
Return to “AutoHotkey Development”
Users browsing this forum: No registered users and 56 guests