Like -I guess- many of us AHKers, I'm trying to investigate the possibilities of the new DllCall command (and btw they seem to be huge! great addition, Chris!). Thing is, I'm quite lost with types, args and syntax in general... So I did a few tests with a very simple API call to get to know better how the whole thing works...
I picked an easy one: InetIsOffline(), located in DLL url.dll
According to the usage:
So, I was trying:
Determines whether or not the system is connected to the Internet.
Input flags for the function. This must be set to zero.
Returns TRUE if the local system is not currently connected to the Internet. Returns FALSE if the local system is connected to the Internet or if no attempt has yet been made to connect to the Internet.
Result:=DllCall("url.dll\InetIsOffline","int",0) msgbox,%Result%About the above DllCall command, according to the usage statement the call only requires 1 parameter, which has to be set to 0 (see underlined part above). I didn't specify any "ReturnType" because according to the AHK help file, "If the function returns an integer, BOOL, or nothing at all, ReturnType may be omitted."
The problem is that %Result% is always 0 (being connected to internet or not), which I guess indicates the dllcall errorlevel 0 (success), but I can't figure out how to get the "TRUE/FALSE" that the function is supposed to return
No matter what I try (specifying types int, int64, uint, etc., specifying VarSetCapacity, specifying a ReturnType, loading the dll beforehand...) the result is always 0 (success) but I don't get my TRUE/FALSE!
Am I missing something? (sure I am, but what? ;-)