06-06-2023, 04:02 AM
(06-06-2023, 03:43 AM)eoredson Wrote: That's even more confusing. I am also using _unsigned long for functions concerning attribute returns.You simply need to read the Microsoft documentation and understand the C++ types used. See the CreateFileA description. `DWORD` is a 32-bit integer, which in QB64 is a `LONG`. `LPCSTR` is a string pointer, and translates to a `String` in QB64 (passed by reference, but that's the default). `LPSECURITY_ATTRIBUTES` is a pointer (LP), so it should be an `_Offset`. And `HANDLE` is a typedef for a `void *`, so in QB64 it should be an `_Offset`.
Do I have to modify them as well?
As a separate question, is there a reason you're trying to use `CreateFileA` and other Win32 APIs in the first place? The best way to make your program cross platform is to simply avoid using any `Declare Library` or Win32 APIs, and just use built-in commands like `OPEN` to create files. If you're not comfortable understanding the C++ types then you're likely to just keep running into issues trying to use Win32 APIs. They're all intended for being used in C++ code, not QB64, you can call them but you need C++ knowledge to really do it properly.