Next thinBasic 1.7.0.0 preview will have a feature requested some time ago: passing nested UDT structure to API functions as parameter.
It is more difficult to describe than to show
Imagine one of the following API:
[code=thinbasic]
Declare Function GetCursorPos Lib "USER32.DLL" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Declare Function GetClientRect Lib "USER32.DLL" Alias "GetClientRect" (ByVal hwnd As Dword, lpRect As RECT) As Long
[/code]
Both expect a structure parameter variable passed BYREF.
But what if your POINTAPI or RECT variable are inside a personalized UDT (maybe 2/3 level deeper)? For example like the following UDT:
[code=thinbasic]type MyType
'---....
MyPT As POINTAPI
MyRC As RECT
'---....
end type
'...
DIM MyVAR as MyType
DIM hWnd as LONG
[/code]
Since now you had to put in place some trick like getting the pointer to MyVAR.MyPT using VARPTR and then pass that pointer to the API function.
In next thinBasic 1.7.0.0 you will just simply:
[code=thinbasic]
GetCursorPos MyVAR.MyPT
'...
GetClientRect hWnd, MyVAR.MyRC[/code]
thinBasic will now do homeworks on this
Hope you like it.
Eros
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Hi Eros,
good! I really like it!
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Bookmarks