I just realized today looking for a way to cast to a byte that I could (ab)use The DllStructSetData() function for conversion
I didn't see anything when I searched the forums so maybe this is frowned upon?
Bool and UINT64 doesn't seem quite right but this might just be a limitation of the AutoIt variables
;Autoit Cast
Global $asTypes[] = ["BOOL", "BYTE", "CHAR", "WCHAR", "SHORT", "USHORT", "WORD", "INT", "UINT", "INT64", "UINT64"]
Global $avValues[] = [0, 1, -1, -128, 127, -255, 255, -32768, 32767, -65535, 65535, -2147483648, 2147483647, _
-4294967295, 4294967295, -9223372036854775808, 9223372036854775807]
Global $g_tData
For $i = 0 To UBound($asTypes) - 1
$g_tData = DllStructCreate($asTypes[$i])
ConsoleWrite($asTypes[$i] & ":" & @CRLF)
For $j = 0 To UBound($avValues) - 1
ConsoleWrite("IN: " & $avValues[$j] & " OUT: " & DllStructSetData($g_tData, 1, $avValues[$j]) & @CRLF)
Next
Next