06-06-2023, 12:11 AM
(06-05-2023, 11:58 PM)eoredson Wrote: If the entire problem is with the function declaration then I have got it wrong the whole time.The code looks good to me, and seems to work
Yes it was technically wrong the whole time. The catch is that because
_Offsetis 32-bits wide in 32-bit QB64, and a
Longis also 32-bits wide, using
CreateFileA&happens to work anyway when using 32-bit QB64. It's only when using 64-bit QB64 that the
_Offsetvs
Longdistinction matters.
To make your code portable between 32-bit and 64-bit you should ensure you use
_Offsetfor any value that needs to vary in size depending on the platform (That goes for all pointer types, such as
HANDLEin Win32).