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.
Do I have to modify them as well?
DWORDis a 32-bit integer, which in QB64 is a
LONG.
LPCSTRis a string pointer, and translates to a
Stringin QB64 (passed by reference, but that's the default).
LPSECURITY_ATTRIBUTESis a pointer (LP), so it should be an
_Offset. And
HANDLEis a typedef for a
void *, so in QB64 it should be an
_Offset.
As a separate question, is there a reason you're trying to use
CreateFileAand other Win32 APIs in the first place? The best way to make your program cross platform is to simply avoid using any
Declare Libraryor Win32 APIs, and just use built-in commands like
OPENto 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.