Invalid return type for DllCall Topic is solved

Discuss the future of the AutoHotkey language
gqqnbig
Posts: 11
Joined: 27 Jul 2014, 15:00

Invalid return type for DllCall

10 Feb 2018, 01:55

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



This is the script that takes process ID and returns the path of the process. It works fine in AutoHotKey v1 but when it runs in V2, DllCall has error "Invalid return type". How do I fix that?

My AutoHotKey version is a086

无标题.png
无标题.png (12.12 KiB) Viewed 190 times
just me
Posts: 5396
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Invalid return type for DllCall

10 Feb 2018, 02:33

I doubt that

Code: [Select all] [Download] GeSHi © Codebox Plus

DllCall "CloseHandle", h_process
is working in v1.

If you pass an even number of parameters to DllCall(), the last parameter must be the return type (which can be a variable).
guest3456
Posts: 2312
Joined: 09 Oct 2013, 10:31

Re: Invalid return type for DllCall

10 Feb 2018, 13:35

its also weird how the string is getting interpreted as "Close111Handle"

Helgef
Posts: 2990
Joined: 17 Jul 2016, 01:02
Contact:

Re: Invalid return type for DllCall

10 Feb 2018, 13:46

Sharp eyes guest3456. It doesn't happen on my pc though,

Code: [Select all] [Expand] [Download] (Untitled.txt)GeSHi © Codebox Plus


:arrow: 2.0-a088-338ed55

Cheers.
guest3456
Posts: 2312
Joined: 09 Oct 2013, 10:31

Re: Invalid return type for DllCall  Topic is solved

10 Feb 2018, 14:11

just me wrote:I doubt that

Code: [Select all] [Download] GeSHi © Codebox Plus

DllCall "CloseHandle", h_process
is working in v1.

If you pass an even number of parameters to DllCall(), the last parameter must be the return type (which can be a variable).


yes obviously the code should be

Code: [Select all] [Download] GeSHi © Codebox Plus

DllCall "CloseHandle", "uint", h_process

Code: [Select all] [Download] GeSHi © Codebox Plus

DllCall("CloseHandle", "uint", h_process)

gqqnbig
Posts: 11
Joined: 27 Jul 2014, 15:00

Re: Invalid return type for DllCall

10 Feb 2018, 20:49

guest3456 wrote:its also weird how the string is getting interpreted as "Close111Handle"

oh, LOL, I was just testing the code

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 3 guests