Author Topic: WinAPI / library variable type declaration suggestion  (Read 2193 times)

0 Members and 1 Guest are viewing this topic.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
WinAPI / library variable type declaration suggestion
« on: December 14, 2020, 09:51:45 am »
In C/C++, one can declare a variable as a WinAPI custom variable by doing something like this:

Code: C++: [Select]
  1. STARTUPINFO si = { };

It automatically declares si as a STARTUPINFO struct/TYPE from the included header file that defines STARTUPINFO. I did not need to include the original header file as QB64 already includes it when it compiles. Since we already include this header as well as many other headers even without using DECLARE LIBRARY, it would be awesome to do something like this:

Code: QB64: [Select]
  1.   TYPE STARTUPINFOA 'or even: TYPE STARTUPINFO ALIAS STARTUPINFOA
  2.   '...etc
  3.  
  4. DIM si AS STARTUPINFOA
  5. 'fill the type

This, I'm sure, will require backend changes. Maybe too many. It would just make things much easier for those of us (@Dav, @Petr, @Juanjogomez, myself, and others) who use WinAPI or other C/C++ libraries to implement maybe many more APIs in QB64 and possibly wouldn't even require to do $IF blocks to change TYPE sizes. Just a suggestion. I'm sure it is quite a hefty request.
« Last Edit: December 14, 2020, 10:54:28 am by SpriggsySpriggs »
Shuwatch!