06-05-2023, 05:56 AM
'CreateFileA' returns a HANDLE, which should be treated as an `_Offset`, but you wrote it as `CreateFileA&`, so the return value is treated as a 32-bit `LONG`.
The C++ compiler isn't allowing you to make the mistake of casting the HANDLE value to a LONG (which is what QB64 will do to make your function definition work) because that's always a bug on 64-bit systems and chops-off the top-half of the 64-bit HANDLE value, making it useless.
The C++ compiler isn't allowing you to make the mistake of casting the HANDLE value to a LONG (which is what QB64 will do to make your function definition work) because that's always a bug on 64-bit systems and chops-off the top-half of the 64-bit HANDLE value, making it useless.