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
![Smile Smile](https://qb64phoenix.com/forum/images/smilies/smile.png)
Yes it was technically wrong the whole time. The catch is that because `_Offset` is 32-bits wide in 32-bit QB64, and a `Long` is 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 `_Offset` vs `Long` distinction matters.
To make your code portable between 32-bit and 64-bit you should ensure you use `_Offset` for any value that needs to vary in size depending on the platform (That goes for all pointer types, such as `HANDLE` in Win32).