DllCall incorrect suffix (A instead of W) Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
MiM
Posts: 61
Joined: 20 Apr 2021, 04:31

DllCall incorrect suffix (A instead of W)

Post by MiM » 18 Jul 2022, 20:48

As docs state:
If no function can be found by the given name, an A (ANSI) or W (Unicode) suffix is automatically appended based on which version of AutoHotkey is running the script. For example, "MessageBox" is the same as "MessageBoxA" in ANSI versions and "MessageBoxW" in Unicode versions.
The thing is, with for example the DragQueryFile function if i don't specify A or W like so:

Code: Select all

DllCall("Shell32.dll\DragQueryFile".....
AutoHotkey chooses the wrong one for me (A)
I know i can do something like ~

Code: Select all

DragQueryFile := "Shell32.dll\DragQueryFile" . (A_IsUnicode ? "W" : "A")
DllCall(DragQueryFile.....
I'm just looking for an explanation why AutoHotkey chooses the wrong suffix for me.

My executable is AutoHotKey Unicode 64-Bit.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: DllCall incorrect suffix (A instead of W)  Topic is solved

Post by swagfag » 11 Aug 2022, 19:50

u should check ur shell32.dll, in mine DragQueryFile = DragQueryFileA = DragQueryFileAorW:
image.png
image.png (8.48 KiB) Viewed 277 times
so nothing to do with AHK choosing the wrong suffix for u at all. in fact, AHK never did choose a suffix - the desired function already exists. in other words, take it up with microsoft

User avatar
MiM
Posts: 61
Joined: 20 Apr 2021, 04:31

Re: DllCall incorrect suffix (A instead of W)

Post by MiM » 13 Aug 2022, 11:43

Hm alright, i guess it's my fault for using win8.1 (i assume it's "fixed" in win10 or whatever)
Annoying that this happens with quite a few functions, thanks for clarifying anyways!

Post Reply

Return to “Ask for Help (v1)”